-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
3 changed files
with
71 additions
and
168 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
67 changes: 67 additions & 0 deletions
67
patches/BRM042_Canvas-fingerprinting-mitigations-via-IDL.patch
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,67 @@ | ||
From: csagan5 <32685696+csagan5@users.noreply.github.com> | ||
Date: Sat, 24 Mar 2018 05:18:03 +0100 | ||
Subject: Canvas: fingerprinting mitigations via IDL | ||
|
||
Disable toDataURL, toBlob, getImageData and webGL renderering info | ||
--- | ||
third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.idl | 4 ++-- | ||
.../Source/modules/canvas/canvas2d/CanvasRenderingContext2D.idl | 4 ++-- | ||
third_party/WebKit/Source/modules/webgl/WebGLDebugRendererInfo.cpp | 4 ++-- | ||
3 files changed, 6 insertions(+), 6 deletions(-) | ||
|
||
diff --git a/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.idl b/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.idl | ||
--- a/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.idl | ||
+++ b/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.idl | ||
@@ -36,9 +36,9 @@ interface HTMLCanvasElement : HTMLElement | ||
// Note: The arguments argument is variadic in the spec, but not here as | ||
// only one extra argument is actually used. | ||
// FIXME: type should not have a default value. | ||
- [MeasureAs=CanvasToDataURL, RaisesException] DOMString toDataURL(optional DOMString type = null, optional any arguments); | ||
+ //[MeasureAs=CanvasToDataURL, RaisesException] DOMString toDataURL(optional DOMString type = null, optional any arguments); | ||
|
||
- [MeasureAs=CanvasToBlob, RaisesException] void toBlob(BlobCallback _callback, optional DOMString type = null, optional any arguments); | ||
+ //[MeasureAs=CanvasToBlob, RaisesException] void toBlob(BlobCallback _callback, optional DOMString type = null, optional any arguments); | ||
}; | ||
|
||
// https://html.spec.whatwg.org/multipage/canvas.html#blobcallback | ||
diff --git a/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.idl b/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.idl | ||
--- a/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.idl | ||
+++ b/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.idl | ||
@@ -110,7 +110,7 @@ interface CanvasRenderingContext2D { | ||
// text (see also the CanvasDrawingStyles interface) | ||
void fillText(DOMString text, unrestricted double x, unrestricted double y, optional unrestricted double maxWidth); | ||
void strokeText(DOMString text, unrestricted double x, unrestricted double y, optional unrestricted double maxWidth); | ||
- TextMetrics measureText(DOMString text); | ||
+ //TextMetrics measureText(DOMString text); | ||
|
||
// drawing images | ||
[CallWith=ScriptState, RaisesException] void drawImage(CanvasImageSource image, unrestricted double x, unrestricted double y); | ||
@@ -125,7 +125,7 @@ interface CanvasRenderingContext2D { | ||
// pixel manipulation | ||
[RaisesException] ImageData createImageData(ImageData imagedata); | ||
[RaisesException] ImageData createImageData(long sw, long sh); | ||
- [RaisesException] ImageData getImageData(long sx, long sy, long sw, long sh); | ||
+ //[RaisesException] ImageData getImageData(long sx, long sy, long sw, long sh); | ||
[RaisesException] void putImageData(ImageData imagedata, long dx, long dy); | ||
[RaisesException] void putImageData(ImageData imagedata, long dx, long dy, long dirtyX, long dirtyY, long dirtyWidth, long dirtyHeight); | ||
|
||
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLDebugRendererInfo.cpp b/third_party/WebKit/Source/modules/webgl/WebGLDebugRendererInfo.cpp | ||
--- a/third_party/WebKit/Source/modules/webgl/WebGLDebugRendererInfo.cpp | ||
+++ b/third_party/WebKit/Source/modules/webgl/WebGLDebugRendererInfo.cpp | ||
@@ -37,11 +37,11 @@ WebGLExtensionName WebGLDebugRendererInfo::GetName() const { | ||
|
||
WebGLDebugRendererInfo* WebGLDebugRendererInfo::Create( | ||
WebGLRenderingContextBase* context) { | ||
- return new WebGLDebugRendererInfo(context); | ||
+ return nullptr; | ||
} | ||
|
||
bool WebGLDebugRendererInfo::Supported(WebGLRenderingContextBase*) { | ||
- return true; | ||
+ return false; | ||
} | ||
|
||
const char* WebGLDebugRendererInfo::ExtensionName() { | ||
-- | ||
2.7.4 | ||
|
This file was deleted.
Oops, something went wrong.