简体   繁体   中英

How do I override a JS URL override?

I've noticed that I've I'm logged in to FB, and someone has posted a link, when I hover over it my status bar (at the bottom...that's status, right?) shows the URL for the story, but if I right click and say "copy link" the link is transformed into one with FB tracking attached. So for instance someone posted a Boston Review story. The screen and the hover text both show that the URL is:

http://www.bostonreview.net/BR37.4/junot_diaz_paula_moya_drown_race.php

But if I actually click the link or right click and say "copy link address" or "copy link location" the URL is transformed to something like this (I swapped in some x's):

http://www.facebook.com/l.php?u=http%3A%2F%2Fwww.bostonreview.net%2FBR37.4%2Fjunot_diaz_paula_moya_drown_race.php&h=wAQG1wXXXXXyoIDSg_ceA9JIXoBRD_o6XXXXXA0Llo4HA

I can use the element inspector to get around it, but I'm curious about whether I can disable that in other ways.

I realize this is only marginally a programming question, since I really just want to tweak my own browser behavior, but I'm not sure where else to ask.

but I'm curious about whether I can disable that in other ways.

You could write your own user JavaScript / browser extension / bookmarklet, that goes through all the links on a page, and if their href has the right format extracts the u parameter and sets it as the new href …

You can't change links on Facebook. All links on Facebook go through their link tracking page. It's probably used by Facebook in a number of ways (user tracking, anti-virus etc). All links in Faceboo, whether through an app or posted by the user manually, will have this long URL passing through l.php .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM