-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FireMonkey] No permission to access unsafeWindow.__proto__
prop
#664
Comments
GM|VM|TM inject into a Try accessing the Please note that there will be many changes to the userscript environment in MV3. PS. I have created a dedicated FireMonkey repo. |
Thanks for the quick response.
I don't understand what you mean by this. When I log the value of |
I asked Mozilla engineers and this is what they said:
|
Thanks, didn't know that was a thing. But I just tried to get that to work in many different ways but it either did nothing or threw the same error as before. |
For my library it is imperative that it is able to modify the
__proto__
property of the window object, so that it can shim theaddEventListener
function to do selective event discarding: https://github.com/Sv443-Network/UserUtils/blob/main/lib/dom.ts#L128However, when anything on the
__proto__
is accessed, the page itself throws anUncaught Error: Permission denied to access object
, which causes the main page script to throw and halt execution, meaning the entire page doesn't load:Click to show image
This doesn't occur on ViolentMonkey and TamperMonkey, but I did notice the same error on GreaseMonkey.
This could of course be intentional to prevent prototype pollution through userscripts, in which case I would love it if you could add some kind of way of enabling this functionality, like with a userscript metadata directive.
I am aware modifying prototypes is heavily discouraged, but there is literally no other way to achieve this, plus my library isn't the only one relying on this functionality, so I feel like there should be a way to allow it, while making it clear to the end user that that could be a potential attack vector.
Here is an example userscript to reproduce it:
The text was updated successfully, but these errors were encountered: