-
Notifications
You must be signed in to change notification settings - Fork 966
Fix Allow Scripts Once logic for embedded scripts and iframes. #12023
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
Conversation
f74aa67
to
3e37e67
Compare
3e37e67
to
92bc807
Compare
@@ -99,9 +95,6 @@ class BraveContentSettingsAgentImpl | |||
// cache blocked script url which will later be used in `DidNotAllowScript()` | |||
GURL blocked_script_url_; | |||
|
|||
// temporary allowed script origins we preloaded for the next load | |||
base::flat_set<std::string> preloaded_temporarily_allowed_scripts_; |
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.
this doesn't work on reloads, an embedded script is executed before this is applied.
@@ -342,7 +350,7 @@ bool BraveContentSettingsAgentImpl::AllowAutoplay(bool play_requested) { | |||
|
|||
void BraveContentSettingsAgentImpl::SetAllowScriptsFromOriginsOnce( | |||
const std::vector<std::string>& origins) { | |||
preloaded_temporarily_allowed_scripts_ = std::move(origins); | |||
temporarily_allowed_scripts_ = origins; |
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.
origins
is not movable (it's a mojo-generated method).
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.
lgtm
Merging per @rebron |
Verification PASSED on
Used https://www.blizzard.com/en-gb for the following cases to ensure that both
|
Fixed Allow Scripts Once to work for page-embedded scripts.
Resolves brave/brave-browser#20744
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: