Prerequisites
I tried to reproduce the issue when...
Description
Currently, uBO's prevent-canvas scriptlet appears to only cover HTMLCanvasElement.getContext(). This means that it can be bypassed with OffscreenCanvas.getContext().
A specific URL where the issue occurs.
https://abrahamjuliot.github.io/creepjs/
Steps to Reproduce
- Add
abrahamjuliot.github.io##+js(prevent-canvas, /webgl/) to My filters in uBO's Dashboard, and select Apply changes.
- Navigate to
https://abrahamjuliot.github.io/creepjs/, and observe that WebGL is not blocked.
- Navigate back to
My filters, check the box to Allow custom filters requiring trust, add abrahamjuliot.github.io##+js(trusted-suppress-native-method, OffscreenCanvas.prototype.getContext, '"webgl"', abort) and abrahamjuliot.github.io##+js(trusted-suppress-native-method, OffscreenCanvas.prototype.getContext, '"webgl2"', abort) to My filters, and select Apply changes.
- Navigate back to
https://abrahamjuliot.github.io/creepjs/, and observe that WebGL is properly blocked as expected.
Expected behavior
prevent-canvas should protect against both HTMLCanvasElement and OffscreenCanvas methods, to prevent usage of Canvas APIs.
Actual behavior
prevent-canvas only protects against HTMLCanvasElement, meaning that Canvas APIs can still be used with OffscreenCanvas.
uBO version
1.65.0
Browser name and version
Firefox 141.0.3 (Phoenix)
Operating System and version
N/A
Prerequisites
I tried to reproduce the issue when...
Description
Currently, uBO's
prevent-canvasscriptlet appears to only coverHTMLCanvasElement.getContext(). This means that it can be bypassed withOffscreenCanvas.getContext().A specific URL where the issue occurs.
https://abrahamjuliot.github.io/creepjs/Steps to Reproduce
abrahamjuliot.github.io##+js(prevent-canvas, /webgl/)toMy filtersin uBO's Dashboard, and selectApply changes.https://abrahamjuliot.github.io/creepjs/, and observe that WebGL is not blocked.My filters, check the box toAllow custom filters requiring trust, addabrahamjuliot.github.io##+js(trusted-suppress-native-method, OffscreenCanvas.prototype.getContext, '"webgl"', abort)andabrahamjuliot.github.io##+js(trusted-suppress-native-method, OffscreenCanvas.prototype.getContext, '"webgl2"', abort)toMy filters, and selectApply changes.https://abrahamjuliot.github.io/creepjs/, and observe that WebGL is properly blocked as expected.Expected behavior
prevent-canvasshould protect against bothHTMLCanvasElementandOffscreenCanvasmethods, to prevent usage of Canvas APIs.Actual behavior
prevent-canvasonly protects againstHTMLCanvasElement, meaning that Canvas APIs can still be used withOffscreenCanvas.uBO version
1.65.0
Browser name and version
Firefox 141.0.3 (Phoenix)
Operating System and version
N/A