├── .gitignore ├── .version ├── LICENSE ├── Makefile ├── README.md └── src ├── background.js ├── content.js ├── icon-128.png ├── inject.js └── manifest.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.pem 2 | *.crx 3 | dist/ 4 | -------------------------------------------------------------------------------- /.version: -------------------------------------------------------------------------------- 1 | 1.3.1 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2018, Maxim Baz 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | VERSION ?= $(shell cat .version) 2 | NAME = browser-fingerprint-protector 3 | 4 | CLEAN_FILES := chromium firefox dist 5 | CHROME := $(shell which chromium 2>/dev/null || which chromium-browser 2>/dev/null || which chrome 2>/dev/null || which google-chrome 2>/dev/null || which google-chrome-stable 2>/dev/null) 6 | 7 | .PHONY: all 8 | all: dist 9 | 10 | .PHONY: crx-webstore 11 | crx-webstore: 12 | "$(CHROME)" --disable-gpu --pack-extension=./src --pack-extension-key=webstore.pem 13 | mv src.crx $(NAME)-webstore.crx 14 | 15 | .PHONY: clean 16 | clean: 17 | rm -rf dist 18 | rm -f *.crx 19 | 20 | .PHONY: dist 21 | dist: clean crx-webstore 22 | mkdir -p dist 23 | 24 | git archive -o dist/$(NAME)-$(VERSION).tar.gz --format tar.gz --prefix=$(NAME)-$(VERSION)/ $(VERSION) 25 | 26 | (cd src && zip -r ../dist/$(NAME)-$(VERSION).zip *) 27 | mv $(NAME)-webstore.crx dist/$(NAME)-webstore-$(VERSION).crx 28 | 29 | for file in dist/*; do \ 30 | gpg --detach-sign --armor "$$file"; \ 31 | done 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Browser Fingerprint Protector 2 | 3 | ## This extension is no longer maintained or recommended, as I don't believe this battle can be won. To try to protect against fingerprinting attacks, consider using Tor Browser or similar projects. 4 | 5 | ~Available in [Firefox Add-ons](https://addons.mozilla.org/en-US/firefox/addon/browser-fingerprint-protector/) and [Chrome Web Store](https://chrome.google.com/webstore/detail/browser-fingerprint-prote/kcklikpoajnpdpjgamjfepagpdkhahpn).~ 6 | 7 | ## How it works 8 | 9 | The extension protects the information in `window.navigator` and HTTP request headers to complicate browser fingerprinting. 10 | 11 | - Completely hides `mimeTypes` and `plugins`. 12 | - Pretends that you only have `English US` language. 13 | - Pretends that you use `Windows 10`. 14 | 15 | ## How to validate that it works 16 | 17 | - [whoer.net](https://whoer.net/) is a good way to see what browser is leaking. Ignore the "anonymity percentage", focus on the information that it is able to retrieve, such as languages, user agent, plugins, etc. 18 | - [Most Common User Agents](https://techblog.willshouse.com/2012/01/03/most-common-user-agents/) is a website that shows the current most common user agent. It is expected that with this extension your browser is listed among the first few entries in the table. 19 | 20 | ## Other useful extensions to protect your privacy 21 | 22 | - [HTTPS Everywhere](https://chrome.google.com/webstore/detail/https-everywhere/gcbommkclmclpchllfjekcdonpmejbdp?utm_source=chrome-app-launcher-info-dialog) 23 | - [uBlock Origin](https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm?utm_source=chrome-app-launcher-info-dialog) 24 | 25 | ## Credits 26 | 27 | Icon made by [Freepik](http://www.freepik.com) from [Flaticon](https://www.flaticon.com/) is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/). 28 | -------------------------------------------------------------------------------- /src/background.js: -------------------------------------------------------------------------------- 1 | var extraInfoSpec = ["blocking", "requestHeaders"]; 2 | if ( 3 | chrome.webRequest.OnBeforeSendHeadersOptions.hasOwnProperty("EXTRA_HEADERS") 4 | ) { 5 | extraInfoSpec.push("extraHeaders"); 6 | } 7 | 8 | chrome.webRequest.onBeforeSendHeaders.addListener( 9 | (details) => { 10 | for (let i = 0; i < details.requestHeaders.length; i++) { 11 | if (details.requestHeaders[i].name === "User-Agent") { 12 | const originalUserAgent = details.requestHeaders[i].value; 13 | const fakeUserAgent = originalUserAgent.replace( 14 | /\(.*?(?=(; rv:[^\)]+)?\))/, 15 | "(Windows NT 10.0; Win64; x64" 16 | ); 17 | details.requestHeaders[i].value = fakeUserAgent; 18 | } else if (details.requestHeaders[i].name === "Accept-Language") { 19 | details.requestHeaders[i].value = "en-US,en;q=0.5"; 20 | } 21 | } 22 | return { requestHeaders: details.requestHeaders }; 23 | }, 24 | { urls: [""] }, 25 | extraInfoSpec 26 | ); 27 | -------------------------------------------------------------------------------- /src/content.js: -------------------------------------------------------------------------------- 1 | var script = document.createElement("script"); 2 | script.src = chrome.extension.getURL("inject.js"); 3 | script.onload = function () { 4 | this.remove(); 5 | }; 6 | (document.head || document.documentElement).appendChild(script); 7 | -------------------------------------------------------------------------------- /src/icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximbaz/browser-fingerprint-protector/13b7c76a3a7eca249976368ffbec5e522f568ae9/src/icon-128.png -------------------------------------------------------------------------------- /src/inject.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | "use strict"; 3 | 4 | const originalUserAgent = window.navigator.userAgent; 5 | const fakeUserAgent = originalUserAgent.replace( 6 | /\(.*?(?=(; rv:[^\)]+)?\))/, 7 | "(Windows NT 10.0; Win64; x64" 8 | ); 9 | const fakeVersion = fakeUserAgent.substr(8); 10 | 11 | window.navigator.__defineGetter__("appVersion", function () { 12 | return fakeVersion; 13 | }); 14 | window.navigator.__defineGetter__("language", function () { 15 | return "en-US"; 16 | }); 17 | window.navigator.__defineGetter__("languages", function () { 18 | return ["en-US", "en"]; 19 | }); 20 | window.navigator.__defineGetter__("mimeTypes", function () { 21 | return { 22 | length: 0, 23 | item: () => null, 24 | namedItem: () => null, 25 | refresh: () => {}, 26 | }; 27 | }); 28 | window.navigator.__defineGetter__("oscpu", function () { 29 | return undefined; 30 | }); 31 | window.navigator.__defineGetter__("platform", function () { 32 | return "Win32"; 33 | }); 34 | window.navigator.__defineGetter__("plugins", function () { 35 | return { 36 | length: 0, 37 | item: () => null, 38 | namedItem: () => null, 39 | refresh: () => {}, 40 | }; 41 | }); 42 | window.navigator.__defineGetter__("userAgent", function () { 43 | return fakeUserAgent; 44 | }); 45 | })(); 46 | -------------------------------------------------------------------------------- /src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "Browser Fingerprint Protector", 4 | "description": "Prevents browser fingerprinting by spoofing your plugins, languages and user agent", 5 | "version": "1.3.1", 6 | "homepage_url": "https://github.com/maximbaz/browser-fingerprint-protector", 7 | "author": "Maxim Baz", 8 | "icons": { 9 | "128": "icon-128.png" 10 | }, 11 | "permissions": ["", "webRequest", "webRequestBlocking"], 12 | "background": { 13 | "scripts": ["background.js"] 14 | }, 15 | "content_scripts": [ 16 | { 17 | "matches": [""], 18 | "js": ["content.js"], 19 | "run_at": "document_start", 20 | "all_frames": true 21 | } 22 | ], 23 | "web_accessible_resources": ["inject.js"] 24 | } 25 | --------------------------------------------------------------------------------