Giter Site home page Giter Site logo

martin-braun / autoreferer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from garywill/autoreferer

1.0 0.0 0.0 77 KB

Browser addon. Control referer to protect privacy and not break web. The addon (maybe the only one?) that deals with Firefox's document.referrer bug ๐Ÿ›ก๏ธ๐Ÿ›ฃ๏ธ

Home Page: https://garywill.github.io

License: GNU General Public License v2.0

Shell 1.19% JavaScript 84.02% HTML 14.79%

autoreferer's Introduction

Auto Referer

Control HTTP referer to protect privacy and not break web.

Notice: Due to browser bug on javascript document.referrer on Firefox 69+ (1601496, 1601743) (also on Chrome), using a regular referer controlling addon you can get 70% of expected protection until they fix that bug.

So, we've implemented a workaround to improve protection to 85%. Please enable workaround in addon settings .

Referer Policy of this Addon

  1. For webs' top frame (i.e. clicking link, navigating, redirecting etc.):

    1. If origin and target url have same domain, allow trimmed referer

    2. If origin and target url have different domain, no referer

  2. For in-page resources (images, videos, js, css etc.), allow trimmed referer (this is the key to not break most webs, also a balance between privacy and experience)

  3. Trim referer: Any referer should be no more than http(s)://domain-name:port/ (like Firefox's native about:config setting network.http.referer.trimmingPolicy = 2).

  4. Not allow referer that not starts with "http" or "https". (Please feedback if you find something broken due to this)

  5. No referer when downgrade from HTTPS/WSS to HTTP/WS

We believe that can protect privacy enough and won't break web.

document.referrer bug workaround

This addon doesn't use content script. Content script hiding document.referrer is not 100% reliable.

Instead, we use this workaround to kill document.referrer:

Cancel all cross-domain navigating requests and make freshnew ones, like directly hit (currently only implemented for GET method and main frame, other methods and sub-frames remain as is)

Fallback operation

If user find a web broken, user can temporary set this addon disabled via toolbar button for:

  • this one tab
  • this one tab and new tabs opened by this tab
  • this one window (Firefox only)
  • globally

(above can be set as keyboard shortcuts)

there's showy toolbar button badge indicating fallback disabling status.

Allowlist

Currently it has hard-coded allowlist.

Disclaimer

This open souce addon comes with no warranty. Use on you own risk!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.