-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Freeze JS APIs on Ad-blocking scripts #24949
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
base: master
Are you sure you want to change the base?
Conversation
| return value; | ||
| }; | ||
|
|
||
| /// Secure URL object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to call secure object on these, just like on line 133.
Otherwise these do nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well they keep people from changing the definition of URL to a string. Which is essentially what I want here. But calling secureObject on these results in the following errors:
TypeError: ProxyObject is not a constructor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with it, but I believe they can still technically change the original definition by re-defining the object's functions or w/e.
I'll see if I can add a proxy constructor trap. If it works then we can add it to this PR, if not, it's okay and I'll approve this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just have to be careful here. some of these are used in our farbling script so these secure objects some will become available to the web page itself. Perhaps I shouldn't use these there but instead use window.. Or perhaps we shouldn't secure those specific APIs
|
A Storybook has been deployed to preview UI for the latest push |
Resolves brave/brave-browser#40173
Submitter Checklist:
QA/YesorQA/No;release-notes/includeorrelease-notes/exclude;OS/...) to the associated issuenpm run test -- brave_browser_tests,npm run test -- brave_unit_testswikinpm run presubmitwiki,npm run gn_check,npm run tslintgit rebase master(if needed)Reviewer Checklist:
gnAfter-merge Checklist:
changes has landed on
Test Plan: