-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
release: | ||
zip -r build.zip extension |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# AudioContext Scrambler | ||
|
||
Protects you against AudioContext fingerprinting by adding random noise. | ||
|
||
## What is AudioContext Fingerprinting | ||
|
||
|
||
## Installation | ||
|
||
### From the store | ||
|
||
As any addons, navigate to its [store page](https://example.com) and click | ||
`Install`. | ||
|
||
### From releases | ||
|
||
1. Download the XPI file from Github Releases | ||
2. Navigate to about:addons | ||
3. Install Add-on from file | ||
4. Select the XPI file | ||
|
||
#### Build it myself | ||
|
||
Use `make release` to create the same XPI file as releases | ||
|
||
## Difference with the existing AudioContext Fingerprint Defender | ||
|
||
While the prupose is the same, this extension fixes several problems I had with | ||
AFD : | ||
- AFD inject code in the page as a script element | ||
- AFD then inject code in iframes if the document doesn't contain the attribute | ||
`data-acxscriptallow` | ||
|
||
This extension uses `exportFunction`. This means that the DOM is not modified. | ||
Unlike AFD, this extension cannot be blocked by setting CSP to `unsafe-inline` | ||
or presetting `data-acxscriptallow` and using iframes. | ||
|
||
Finally, this extension has a Github repository so that everyone can participate | ||
and improve it. | ||
|
||
## Support | ||
|
||
This extension currently only support Firefox and Firefox for Android. | ||
|
||
## What's next? | ||
|
||
- Notify you when a page is trying to fingerprint you | ||
- Support Chromium | ||
- Configurable noise amplitude |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
|
||
"manifest_version": 2, | ||
"name": "AudioContext Scrambler", | ||
"version": "1.0", | ||
|
||
"description": "Scramble channel data to avoid AudioContext fingerprinting", | ||
|
||
"content_scripts": [ | ||
{ | ||
"matches": ["*://*/*"], | ||
"run_at": "document_start", | ||
"js": ["scrambler.js"] | ||
} | ||
] | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
function createCustomChannelData(target) { | ||
const original = target.prototype.getChannelData; | ||
let buffer = null; | ||
let getChannelData = function () { | ||
const originalResult = original.apply(this, arguments); | ||
if (buffer !== originalResult) { | ||
buffer = originalResult; | ||
for (var i = 0; i < originalResult.length; i += 100) { | ||
let index = Math.floor(Math.random() * i); | ||
originalResult[index] = originalResult[index] + Math.random() * 0.0000001; | ||
} | ||
} | ||
return originalResult; | ||
}; | ||
exportFunction(getChannelData, target.prototype, {defineAs:'getChannelData'}); | ||
} | ||
|
||
function createCustomAnalyserNode(target) { | ||
const original = target.prototype.getFloatFrequencyData; | ||
let getFloatFrequencyData = function () { | ||
const originalResult = original.apply(this, arguments); | ||
for (var i = 0; i < arguments[0].length; i += 100) { | ||
let index = Math.floor(Math.random() * i); | ||
arguments[0][index] = arguments[0][index] + Math.random() * 0.1; | ||
} | ||
return originalResult; | ||
}; | ||
exportFunction(getFloatFrequencyData, target.prototype, {defineAs:'getFloatFrequencyData'}); | ||
} | ||
|
||
createCustomChannelData(window.AudioBuffer); | ||
createCustomChannelData(window.OfflineAudioContext); | ||
createCustomAnalyserNode(window.AnalyserNode); |