-
Notifications
You must be signed in to change notification settings - Fork 32
Closed
Labels
Description
TrustedScriptURL is not defined in Firefox and scriptlet does not work correctly.
Steps to reproduce:
- Add to user rules:
example.org#%#//scriptlet('prevent-element-src-loading', 'script', 'test.js')- Go to - https://example.org/
- Open devtools and run in console:
(() => {
const script = document.createElement('script');
script.src = 'test.js';
document.body.appendChild(script);
})();There is an error: Uncaught ReferenceError: TrustedScriptURL is not defined.
The problem seems to be here:
| if (policy && urlValue instanceof TrustedScriptURL) { |
TrustedScriptURL is undefined and urlValue instanceof TrustedScriptURL throws error.I guess we can change it to:
if (policy && policy.isSupported && urlValue instanceof TrustedScriptURL) { zloyden
