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
* window (disabled by default)
* DOMRect
* SVG
* TextMetrics
* navigator (disabled by default)
* screen

View File

@ -162,6 +162,10 @@
"message": "DOMRect API",
"description": ""
},
"section_SVG-api": {
"message": "SVG API",
"description": ""
},
"section_TextMetrics-api": {
"message": "TextMetrics API",
"description": ""
@ -313,6 +317,18 @@
"message": "Do you want to allow DOMRect API readout?",
"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": {
"message": "Do you want to allow the TextMetrics API?",
"description": ""
@ -751,6 +767,10 @@
"message": "Faked DOMRect readout on {url}",
"description": ""
},
"fakedSVGReadout": {
"message": "Faked SVG readout on {url}",
"description": ""
},
"fakedTextMetricsReadout": {
"message": "Faked TextMetrics readout on {url}",
"description": ""
@ -1208,6 +1228,19 @@
"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": {
"message": "Protect TextMetrics API",
"description": ""

View File

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

View File

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

View File

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

View File

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

View File

@ -83,6 +83,7 @@
{mainFlag: "protectAudio", section: "Audio-API"},
{mainFlag: "protectWindow", section: "Window-API"},
{mainFlag: "protectDOMRect", section: "DOMRect-API"},
{mainFlag: "protectSVG", section: "SVG-API"},
{mainFlag: "protectTextMetrics", section: "TextMetrics-API"},
{mainFlag: "protectNavigator", section: "Navigator-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",
settings: [

View File

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

View File

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

View File

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

View File

@ -209,6 +209,10 @@
{
"version": "1.8Alpha20211107",
"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"
}
]
}