commit d78b27c29a70c2f6a773e4ba4d1d7b5b9b20f1e8 Author: Andrei O Date: Fri Mar 25 20:10:48 2022 +0200 first commit diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..9097cfd --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "tabWidth": 2, + "useTabs": false, + "printWidth": 150, + "trailingComma": "all", + "singleQuote": true +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..128ec4d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "prettier.enable": true, + "editor.formatOnSave": true +} \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9604672 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Andrei O. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/PRIVACY_POLICY.md b/PRIVACY_POLICY.md new file mode 100644 index 0000000..fd79417 --- /dev/null +++ b/PRIVACY_POLICY.md @@ -0,0 +1,13 @@ +# 𝐏𝐫𝐢𝐯𝐚𝐜𝐲 𝐏𝐨𝐥𝐢𝐜𝐲: + +## Privacy Points: + +- This extension does not collect any data form your device. +- This extension does not use external files, everything is packed into the extension. +- This extension uses the manifest V3 which does not allow any third party scripts to be injected. +- The extension needs host permissions to inject a script to modify the navigator object. +- This extension is completely open source, the source is available on Github - [https://https://github.com/andrei0x309/Brave-Detection-Blocker-Chrome-Extension](https://https://github.com/andrei0x309/Brave-Detection-Blocker-Chrome-Extension). + +### 𝐂𝐨𝐧𝐭𝐚𝐜𝐭: + +Discord: andrei0x309#6562 diff --git a/README.md b/README.md new file mode 100644 index 0000000..10dd1ba --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# Brave Detection Block BDB (chrome extension): + +![BDB LOGO](/images/BDB-ICON256.png?raw=true "BDB LOGO") + +Although Brave is a good privacy browser it has some features that are pretty against privacy like an official method for website to detect you are running brave. + +This method is by cheking a custom property on the navigator object, accessable at `window.navigator.brave`. + +This is probably a point where marketing and data collection coliedes with any privacy ethos. + +This extension is ment to delete that property and make it impossible to detect if you are running brave using that method. + +Download from Chrome-Store(only download if you are running Brave): + +[Brave-Detection-Blocker-Chrome-Extension](https://https://github.com/andrei0x309/Brave-Detection-Blocker-Chrome-Extension) + +## Privacy Policy Link: + +[PRIVACY_POLICY.md](PRIVACY_POLICY.md) + +### License: + +MIT + +### Notes: + +This extension was made to be compatible with [Random User Agent](https://github.com/tarampampam/random-user-agent/) extension. + +### 𝐂𝐨𝐧𝐭𝐚𝐜𝐭: + +Discord: andrei0x309#6562 diff --git a/_locales/en/messages.json b/_locales/en/messages.json new file mode 100644 index 0000000..8286f15 --- /dev/null +++ b/_locales/en/messages.json @@ -0,0 +1,10 @@ +{ + "appName": { + "message": "Brave Detection Block", + "description": "This extension blocks the official method to detect you use brave browser, install only on Brave browser." + }, + "appDesc": { + "message": "Brave Detection Block", + "description": "This extension blocks the official method to detect you use brave browser, install only on Brave browser." + } +} diff --git a/block-script.js b/block-script.js new file mode 100644 index 0000000..86d661b --- /dev/null +++ b/block-script.js @@ -0,0 +1,28 @@ +function Navigator() {} +newNav = new Navigator(); +const alreadyProxifiedNav = { + userAgent: navigator.userAgent, + appVersion: navigator.appVersion, + platform: navigator.platform, + vendor: navigator.vendor, +}; +for (let prop in window.navigator) { + if (prop === 'brave') { + continue; + } + Object.defineProperty(newNav, prop, { + value: window.navigator[prop], + writable: true, + }); +} +for (let prop in alreadyProxifiedNav) { + alreadyProxifiedNav.hasOwnProperty(prop) && + Object.defineProperty(newNav, prop, { + value: alreadyProxifiedNav[prop], + writable: true, + }); +} +Object.defineProperty(window, 'navigator', { + value: newNav, + writable: true, +}); diff --git a/content-script.js b/content-script.js new file mode 100644 index 0000000..e6ffb73 --- /dev/null +++ b/content-script.js @@ -0,0 +1,17 @@ +const nullthrows = (v) => { + if (v == null) throw new Error("it's a null"); + return v; +}; + +const injectScript = (src) => { + const script = document.createElement('script'); + script.src = src; + script.onload = function () { + this.remove(); + }; + try { + nullthrows(document.head || document.documentElement).appendChild(script); + } catch {} +}; + +injectScript(chrome.runtime.getURL('/block-script.js')); diff --git a/images/BDB-ICON128.png b/images/BDB-ICON128.png new file mode 100644 index 0000000..7f3facc Binary files /dev/null and b/images/BDB-ICON128.png differ diff --git a/images/BDB-ICON16.png b/images/BDB-ICON16.png new file mode 100644 index 0000000..1fc6515 Binary files /dev/null and b/images/BDB-ICON16.png differ diff --git a/images/BDB-ICON256.png b/images/BDB-ICON256.png new file mode 100644 index 0000000..da5a29d Binary files /dev/null and b/images/BDB-ICON256.png differ diff --git a/images/BDB-ICON32.png b/images/BDB-ICON32.png new file mode 100644 index 0000000..6299723 Binary files /dev/null and b/images/BDB-ICON32.png differ diff --git a/images/BDB-ICON48.png b/images/BDB-ICON48.png new file mode 100644 index 0000000..66e4120 Binary files /dev/null and b/images/BDB-ICON48.png differ diff --git a/images/BDB-ICON512.png b/images/BDB-ICON512.png new file mode 100644 index 0000000..e4250db Binary files /dev/null and b/images/BDB-ICON512.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..2ba6c7f --- /dev/null +++ b/manifest.json @@ -0,0 +1,42 @@ +{ + "manifest_version": 3, + "name": "__MSG_appName__", + "description": "__MSG_appDesc__", + "default_locale": "en", + "version": "1.0.0", + "version_name": "1.0.0", + "permissions": [], + "content_scripts": [ + { + "matches": [ + "http://*/*", + "https://*/*" + ], + "js": ["content-script.js"], + "run_at": "document_start" + } + ], + "action": { + "default_popup": "popup.html", + "default_icon": { + "16": "images/BDB-ICON16.png", + "32": "images/BDB-ICON32.png", + "48": "images/BDB-ICON48.png", + "128": "images/BDB-ICON128.png" + } + }, + "web_accessible_resources": [ + { + "resources": [ "block-script.js" ], + "matches": [ "https://*/*" ] + } + ], + "icons": { + "16": "images/BDB-ICON16.png", + "32": "images/BDB-ICON32.png", + "48": "images/BDB-ICON48.png", + "128": "images/BDB-ICON128.png", + "256": "images/BDB-ICON256.png", + "512": "images/BDB-ICON512.png" + } +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/package.json @@ -0,0 +1 @@ +{} diff --git a/popup.html b/popup.html new file mode 100644 index 0000000..da61116 --- /dev/null +++ b/popup.html @@ -0,0 +1,135 @@ + + + + + + +
+
+
+ +
+
+

Brave Detection Block

+ +

While the extension is enabled:

+

window.navigator.brave

+

can't be accessed by any website

+ +
+
+

Notes

+ This extension is used to block detection of brave browser by websites. +

+ It only blocks the official detection which is checking the
window.navigator.brave object
. +

+ The extension does not touch the
user-agent
or try to prevent other methods of detecting brave browser. +

+ For that reason to employ a higher degree of privacy is recomanded to use an user-agent randomizer extension, + set the fingerpint blocking to max in brave settings, and also allow this extension and + the user-agent randomizer extension to work in incognito mode. +

+ If you want even more privacy than that use a no logs VPN doubled by a brave tor window. +

+ If you're even more privacy focused you could set up a private VPN on a VPS bought with a privacy crypto and only, + use DOH for DNS doubled by TOR using only hidden services no exist nodes on a non-persistent OS decrypted at boot time + from a scrambled hidden partition. +

+ (Don't know why you would employ such effort but I'm just trying to be techincal.) +

+

Check source at:

+ + https://github.com/andrei0x309/Brave-Detection-Blocker-Chrome-Extension + +
+
+
+
+
+ + + + diff --git a/popup.js b/popup.js new file mode 100644 index 0000000..7e8e3f6 --- /dev/null +++ b/popup.js @@ -0,0 +1,143 @@ +'use strict'; + + +window.addEventListener( + 'message', + (event) => { + if (event.data.action === 'proxyError') { + displayAlert('error', 'Wrong data, or proxy down double check the input.'); + } + }, + false, +); + +// let btn_close_alert = document.getElementById('closeAlertBtn'); + +// const btnProxyStop = document.getElementById('btnProxyStop'); +// const btnProxyStart = document.getElementById('btnProxyStart'); + + + +// const proxyTypeGroup = document.getElementById('proxyTypeGroup'); + +// const btnProxyType = [ +// document.getElementById('btnProxyTypeHttp'), +// document.getElementById('btnProxyTypeHttps'), +// document.getElementById('btnProxyTypeSocks4'), +// document.getElementById('btnProxyTypeSocks5'), +// ]; + +// for (const btn of btnProxyType) { +// if (btn) { +// btn.onclick = async function () { +// const active = proxyTypeGroup.querySelector('.btn-green'); +// if (active) { +// active.classList.remove('btn-green'); +// } +// this.classList.add('btn-green'); +// bgP.window.extOptions.activeProxy.type = this.id.replace('btnProxyType', '').toLowerCase(); +// await bgP.window.setOptions(bgP.window.extOptions); +// }; +// } +// } + +// const spanProxyStatusOn = document.getElementById('spanProxyStatusOn'); +// const spanProxyStatusOff = document.getElementById('spanProxyStatusOff'); + +// const inputproxyHost = document.getElementById('proxyHost'); +// const inputproxyPort = document.getElementById('proxyPort'); + +// const updatePopup = function (options) { +// if (options.proxyEnabled) { +// spanProxyStatusOff.classList.add('hidden'); +// spanProxyStatusOn.classList.remove('hidden'); + +// btnProxyStart.classList.add('hidden'); +// btnProxyStop.classList.remove('hidden'); +// } else { +// spanProxyStatusOn.classList.add('hidden'); +// spanProxyStatusOff.classList.remove('hidden'); + +// btnProxyStart.classList.remove('hidden'); +// btnProxyStop.classList.add('hidden'); +// } + +// if (options.activeProxy) { +// const types = ['http', 'https', 'socks4', 'socks5']; +// if (options.activeProxy.type) btnProxyType[types.indexOf(options.activeProxy.type)].classList.add('btn-green'); +// inputproxyHost.value = options.activeProxy.host; +// inputproxyPort.value = options.activeProxy.port; +// } +// }; + +// updatePopup(bgP.window.extOptions); + +// btnProxyStop.onclick = function () { +// bgP.window.extOptions.proxyEnabled = false; +// bgP.window.setOptions(bgP.window.extOptions); +// bgP.window.disableProxy(); +// updatePopup(bgP.window.extOptions); +// }; + +// btnProxyStart.onclick = function () { +// bgP.window.extOptions.activeProxy.host = inputproxyHost.value; +// bgP.window.extOptions.activeProxy.port = inputproxyPort.value; +// bgP.window.extOptions.proxyEnabled = true; +// bgP.window.setOptions(bgP.window.extOptions); +// bgP.window.setProxy(bgP.window.extOptions.activeProxy); +// updatePopup(bgP.window.extOptions); +// }; + +// let displayAlert = (type, msg) => { +// if (type === 'error') { +// document.getElementById('exAlertBox').classList.remove('alert-success'); +// document.getElementById('exAlertBox').classList.add('alert-warning'); +// } else if (type === 'success') { +// document.getElementById('exAlertBox').classList.remove('alert-warning'); +// document.getElementById('exAlertBox').classList.add('alert-success'); +// } + +// document.getElementById('alertMsg').innerHTML = msg; +// document.getElementById('exAlert').classList.remove('hidden'); +// }; + +// let closeAlert = () => { +// const alert = document.getElementById('exAlert'); +// if (alert) { +// document.getElementById('exAlert').classList.add('hidden'); +// } +// }; +// closeAlert(); + +// btn_close_alert.addEventListener('click', function () { +// closeAlert(); +// }); + +const myTabs = document.querySelectorAll('ul.nav-tabs > li'); +function myTabClicks(tabClickEvent) { + for (let i = 0; i < myTabs.length; i++) { + myTabs[i].classList.remove('active'); + } + + const clickedTab = tabClickEvent.currentTarget; + clickedTab.classList.add('active'); + tabClickEvent.preventDefault(); + + const myContentPanes = document.querySelectorAll('.tab-pane'); + + for (let i = 0; i < myContentPanes.length; i++) { + myContentPanes[i].classList.remove('active'); + } + + const anchorReference = tabClickEvent.target; + const activePaneId = anchorReference.getAttribute('href'); + const activePane = document.querySelector(activePaneId); + activePane.classList.add('active'); +} + +for (let i = 0; i < myTabs.length; i++) { + myTabs[i].addEventListener('click', myTabClicks); +} + +const imgURL = chrome.runtime.getURL("images/BDB-ICON256.png"); +document.getElementById("logo").src = imgURL;