Removing third-party referrers

Discuss various technical topics not related to Mozilla.
Post Reply
Anonymosity
Posts: 8779
Joined: May 7th, 2007, 12:07 pm

Removing third-party referrers

Post by Anonymosity »

Is there any way to use a script to remove third-party referrers from a browser's request headers? There is no extension for Safari that I could find that could do that, so I was looking for a script for Tampermonkey. I was unsuccessful. Can a script not do that? The script would have to deal not only with anchors, but also with links and scripts.
User avatar
Grumpus
Posts: 13239
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Re: Removing third-party referrers

Post by Grumpus »

Spent some time searching yesterday in Google came up with some header editing suggestions
Hard to tell what or which might do the job.
There was one listing on the Apple developers site which seemed to have some instruction but it might not be relative.
Code editing
. . . and didn't know if this would help, there was a cross platform editing package which seems to have disappeared. Started with lower case "webXXXXX"
playing with referer header
Referer spoofing
Doesn't matter what you say, it's wrong for a toaster to walk around the house and talk to you
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: Removing third-party referrers

Post by morat »

You can change the document.referrer string with Tampermonkey, but not the Referer request header.

You can change the navigator.userAgent string with Tampermonkey, but not the User-Agent request header.

Super User answer
http://superuser.com/a/695049
Anonymosity
Posts: 8779
Joined: May 7th, 2007, 12:07 pm

Re: Removing third-party referrers

Post by Anonymosity »

What is the document.referrer string? Where is it? Would spoofing that prevent tracking when I follow links or load images?
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: Removing third-party referrers

Post by morat »

You can still be tracked using the Referer request header.

document.referrer
http://developer.mozilla.org/en-US/docs ... t/referrer

A script running on a page can consult this property to see the same information that was sent in the Referer request header.
Anonymosity
Posts: 8779
Joined: May 7th, 2007, 12:07 pm

Re: Removing third-party referrers

Post by Anonymosity »

So that is similar to the navigator.userAgent. Javascript can dig it out, but the value in the request header can be different.
I guess there is no code one can use with the Mac Terminal to block anything in the request header for Safari?
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: Removing third-party referrers

Post by morat »

I think Fiddler can rewrite HTTP on the Mac.

Looking for HTTP debugging proxy for Mac
http://superuser.com/questions/42813
http://en.wikipedia.org/wiki/Fiddler_(software)
http://www.telerik.com/fiddler

Safari API sucks.

How modify the request headers using safari extension
http://stackoverflow.com/questions/29824490
Anonymosity
Posts: 8779
Joined: May 7th, 2007, 12:07 pm

Re: Removing third-party referrers

Post by Anonymosity »

Fiddler sounds like a fancy packet-sniffing proxy from the description. All I want is to block tracking when I use Safari!
User avatar
Grumpus
Posts: 13239
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Re: Removing third-party referrers

Post by Grumpus »

Just brainstorming, grain of salt time . . .
Would Safari be able to prefetch or preload the page data first, scan and then pick and choose "allow."
Seems like something that might be more involved than a simple script.
You'd then need some form of Data base for comparison and the slightest syntax change might throw the whole thing off.
Even with some form of speedy gonzo system, if you are applying a gonzo system, might it not get overwhelmed?
If you keyed the ips/urls couldn't you just block those, place them in a database? Same problems?
Doesn't matter what you say, it's wrong for a toaster to walk around the house and talk to you
Anonymosity
Posts: 8779
Joined: May 7th, 2007, 12:07 pm

Re: Removing third-party referrers

Post by Anonymosity »

Instead of just clicking links, I could right-click, choose to copy the location and paste that into the address bar, but that does not help with stopping tracking while picking up images. What is really needed is an extension to remove the third-party referers, but I could not find one, and I did a lot of searches.
User avatar
Grumpus
Posts: 13239
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Re: Removing third-party referrers

Post by Grumpus »

Can you set Safari to accept images only from originating source, would this cut down on some of the third party referrers, at least for the images?
Doesn't matter what you say, it's wrong for a toaster to walk around the house and talk to you
Anonymosity
Posts: 8779
Joined: May 7th, 2007, 12:07 pm

Re: Removing third-party referrers

Post by Anonymosity »

I do not want to do that, since some pages use third-party images, and you lose a significant part of the content if you block those. With Safari, I see no way to do that anyway. Preferences are very limited and there is nothing like about:config for Safari.
Post Reply