1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-12-22 12:50:36 +01:00

Added SVG protection

Fixes #589 and fixes #590
This commit is contained in:
kkapsner 2022-01-30 10:59:41 +01:00
parent 734e76180f
commit 640bd36b86
12 changed files with 84 additions and 4 deletions

View File

@ -15,6 +15,7 @@ Protected "fingerprinting" APIs:
* history * history
* window (disabled by default) * window (disabled by default)
* DOMRect * DOMRect
* SVG
* TextMetrics * TextMetrics
* navigator (disabled by default) * navigator (disabled by default)
* screen * screen

View File

@ -162,6 +162,10 @@
"message": "DOMRect API", "message": "DOMRect API",
"description": "" "description": ""
}, },
"section_SVG-api": {
"message": "SVG API",
"description": ""
},
"section_TextMetrics-api": { "section_TextMetrics-api": {
"message": "TextMetrics API", "message": "TextMetrics API",
"description": "" "description": ""
@ -313,6 +317,18 @@
"message": "Do you want to allow DOMRect API readout?", "message": "Do you want to allow DOMRect API readout?",
"description": "" "description": ""
}, },
"askForSVGPermission": {
"message": "Do you want to allow the SVG API?",
"description": ""
},
"askForSVGInputPermission": {
"message": "Do you want to allow SVG API input?",
"description": ""
},
"askForSVGReadoutPermission": {
"message": "Do you want to allow SVG API readout?",
"description": ""
},
"askForTextMetricsPermission": { "askForTextMetricsPermission": {
"message": "Do you want to allow the TextMetrics API?", "message": "Do you want to allow the TextMetrics API?",
"description": "" "description": ""
@ -751,6 +767,10 @@
"message": "Faked DOMRect readout on {url}", "message": "Faked DOMRect readout on {url}",
"description": "" "description": ""
}, },
"fakedSVGReadout": {
"message": "Faked SVG readout on {url}",
"description": ""
},
"fakedTextMetricsReadout": { "fakedTextMetricsReadout": {
"message": "Faked TextMetrics readout on {url}", "message": "Faked TextMetrics readout on {url}",
"description": "" "description": ""
@ -1208,6 +1228,19 @@
"description": "" "description": ""
}, },
"protectSVG_title": {
"message": "Protect SVG API",
"description": ""
},
"protectSVG_description": {
"message": "This protects against fingerprinting using SVGs.",
"description": ""
},
"protectSVG_urlSpecific": {
"message": "To exclude specific websites from this protection, click on the black arrow to open the menu, add the domain or URL by clicking on \"+\" and remove its checkmark.",
"description": ""
},
"protectTextMetrics_title": { "protectTextMetrics_title": {
"message": "Protect TextMetrics API", "message": "Protect TextMetrics API",
"description": "" "description": ""

View File

@ -88,7 +88,8 @@
audio: _("askForAudioPermission"), audio: _("askForAudioPermission"),
history: _("askForHistoryPermission"), history: _("askForHistoryPermission"),
window: _("askForWindowPermission"), window: _("askForWindowPermission"),
domRect: _("askForDOMRectPermission") domRect: _("askForDOMRectPermission"),
svg: _("askForSVGPermission"),
}, },
askStatus: { askStatus: {
alreadyAsked: {}, alreadyAsked: {},
@ -103,7 +104,8 @@
audio: _("askForAudioInputPermission"), audio: _("askForAudioInputPermission"),
history: _("askForHistoryInputPermission"), history: _("askForHistoryInputPermission"),
window: _("askForWindowInputPermission"), window: _("askForWindowInputPermission"),
domRect: _("askForDOMRectInputPermission") domRect: _("askForDOMRectInputPermission"),
svg: _("askForSVGInputPermission"),
}, },
askStatus: { askStatus: {
alreadyAsked: {}, alreadyAsked: {},
@ -118,7 +120,8 @@
audio: _("askForAudioReadoutPermission"), audio: _("askForAudioReadoutPermission"),
history: _("askForHistoryReadoutPermission"), history: _("askForHistoryReadoutPermission"),
window: _("askForWindowReadoutPermission"), window: _("askForWindowReadoutPermission"),
domRect: _("askForDOMRectReadoutPermission") domRect: _("askForDOMRectReadoutPermission"),
svg: _("askForSVGReadoutPermission"),
}, },
askStatus: { askStatus: {
alreadyAsked: {}, alreadyAsked: {},

View File

@ -39,6 +39,7 @@
appendModified(require("./modifiedHistoryAPI")); appendModified(require("./modifiedHistoryAPI"));
appendModified(require("./modifiedWindowAPI")); appendModified(require("./modifiedWindowAPI"));
appendModified(require("./modifiedDOMRectAPI")); appendModified(require("./modifiedDOMRectAPI"));
appendModified(require("./modifiedSVGAPI"));
appendModified(require("./modifiedTextMetricsAPI")); appendModified(require("./modifiedTextMetricsAPI"));
appendModified(require("./modifiedNavigatorAPI")); appendModified(require("./modifiedNavigatorAPI"));
appendModified(require("./modifiedScreenAPI")); appendModified(require("./modifiedScreenAPI"));

View File

@ -124,6 +124,10 @@
"intersectionRect @ domRect", "intersectionRect @ domRect",
"boundingClientRect @ domRect", "boundingClientRect @ domRect",
"rootBounds @ domRect", "rootBounds @ domRect",
{name: "SVG-API", level: 1},
"getTotalLength @ svg",
"getComputedTextLength @ svg",
"getSubStringLength @ svg",
{name: "TextMetrics-API", level: 1}, {name: "TextMetrics-API", level: 1},
"width @ textMetrics", "width @ textMetrics",
"actualBoundingBoxAscent @ textMetrics", "actualBoundingBoxAscent @ textMetrics",
@ -280,6 +284,7 @@
"history", "history",
"window", "window",
"domRect", "domRect",
"svg",
"textMetrics", "textMetrics",
"navigator", "navigator",
"screen", "screen",
@ -356,6 +361,11 @@
name: "domRectIntegerFactor", name: "domRectIntegerFactor",
defaultValue: 4 defaultValue: 4
}, },
{
name: "protectSVG",
defaultValue: true,
urlSpecific: true
},
{ {
name: "protectTextMetrics", name: "protectTextMetrics",
defaultValue: true, defaultValue: true,

View File

@ -50,6 +50,7 @@
"lib/modifiedHistoryAPI.js", "lib/modifiedHistoryAPI.js",
"lib/modifiedWindowAPI.js", "lib/modifiedWindowAPI.js",
"lib/modifiedDOMRectAPI.js", "lib/modifiedDOMRectAPI.js",
"lib/modifiedSVGAPI.js",
"lib/modifiedTextMetricsAPI.js", "lib/modifiedTextMetricsAPI.js",
"lib/navigator.js", "lib/navigator.js",
"lib/modifiedNavigatorAPI.js", "lib/modifiedNavigatorAPI.js",

View File

@ -83,6 +83,7 @@
{mainFlag: "protectAudio", section: "Audio-API"}, {mainFlag: "protectAudio", section: "Audio-API"},
{mainFlag: "protectWindow", section: "Window-API"}, {mainFlag: "protectWindow", section: "Window-API"},
{mainFlag: "protectDOMRect", section: "DOMRect-API"}, {mainFlag: "protectDOMRect", section: "DOMRect-API"},
{mainFlag: "protectSVG", section: "SVG-API"},
{mainFlag: "protectTextMetrics", section: "TextMetrics-API"}, {mainFlag: "protectTextMetrics", section: "TextMetrics-API"},
{mainFlag: "protectNavigator", section: "Navigator-API"}, {mainFlag: "protectNavigator", section: "Navigator-API"},
{mainFlag: "protectScreen", section: "Screen-API"}, {mainFlag: "protectScreen", section: "Screen-API"},

View File

@ -627,6 +627,25 @@
}, },
] ]
}, },
{
name: "SVG-API",
settings: [
{
"name": "protectSVG"
},
{
"name": "protectedAPIFeatures",
"replaceKeyPattern": / @ .+$/,
"displayedSection": "SVG-API",
"displayDependencies": [
{
"protectSVG": [true],
"displayAdvancedSettings": [true]
}
]
},
]
},
{ {
name: "TextMetrics-API", name: "TextMetrics-API",
settings: [ settings: [

View File

@ -61,6 +61,12 @@
whitelistValue: false, whitelistValue: false,
protectedValue: true protectedValue: true
}, },
{
title: extension.getTranslation("section_SVG-api"),
name: "protectSVG",
whitelistValue: false,
protectedValue: true
},
{ {
title: extension.getTranslation("section_navigator-api"), title: extension.getTranslation("section_navigator-api"),
name: "protectNavigator", name: "protectNavigator",

View File

@ -75,6 +75,7 @@
canvas: {name: "protectedCanvasPart", value: "nothing"}, canvas: {name: "protectedCanvasPart", value: "nothing"},
audio: {name: "protectAudio", value: false}, audio: {name: "protectAudio", value: false},
domRect: {name: "protectDOMRect", value: false}, domRect: {name: "protectDOMRect", value: false},
svg: {name: "protectSVG", value: false},
history: {name: "historyLengthThreshold", value: 10000}, history: {name: "historyLengthThreshold", value: 10000},
navigator: {name: "protectNavigator", value: false}, navigator: {name: "protectNavigator", value: false},
windows: {name: "protectWindow", value: false}, windows: {name: "protectWindow", value: false},

View File

@ -3,7 +3,7 @@ Version 1.8:
- -
new features: new features:
- - added SVG protection
fixes: fixes:
- -

View File

@ -209,6 +209,10 @@
{ {
"version": "1.8Alpha20211107", "version": "1.8Alpha20211107",
"update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-1.8Alpha20211107-an+fx.xpi" "update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-1.8Alpha20211107-an+fx.xpi"
},
{
"version": "1.8Alpha20220130",
"update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-1.8Alpha20220130-an+fx.xpi"
} }
] ]
} }