Skip to content
This repository was archived by the owner on Dec 11, 2019. It is now read-only.

Block additional fp-related methods #11055

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions app/extensions/brave/content/scripts/blockCanvasFingerprinting.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ if (chrome.contentSettings.canvasFingerprinting == 'block') {
}

var methods = []
var canvasMethods = ['getImageData', 'getLineDash', 'measureText']
var canvasMethods = ['getImageData', 'getLineDash', 'measureText', 'isPointInPath']
canvasMethods.forEach(function (method) {
var item = {
type: 'Canvas',
Expand All @@ -196,7 +196,8 @@ if (chrome.contentSettings.canvasFingerprinting == 'block') {
})

var webglMethods = ['getSupportedExtensions', 'getParameter', 'getContextAttributes',
'getShaderPrecisionFormat', 'getExtension', 'readPixels']
'getShaderPrecisionFormat', 'getExtension', 'readPixels', 'getUniformLocation',
'getAttribLocation']
webglMethods.forEach(function (method) {
var item = {
type: 'WebGL',
Expand Down Expand Up @@ -228,6 +229,26 @@ if (chrome.contentSettings.canvasFingerprinting == 'block') {
methods.push(item)
})

var svgPathMethods = ['getTotalLength']
svgPathMethods.forEach(function (method) {
var item = {
type: 'SVG',
objName: 'SVGPathElement',
propName: method
}
methods.push(item)
})

var svgTextContentMethods = ['getComputedTextLength']
svgTextContentMethods.forEach(function (method) {
var item = {
type: 'SVG',
objName: 'SVGTextContentElement',
propName: method
}
methods.push(item)
})

// Based on https://github.com/webrtcHacks/webrtcnotify
var webrtcMethods = ['createOffer', 'createAnswer', 'setLocalDescription', 'setRemoteDescription']
webrtcMethods.forEach(function (method) {
Expand Down