Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Merge pull request #651 from brave/noscript_issue
Browse files Browse the repository at this point in the history
Issue: 15232 AllowScript should use atom::ContentSettingsManager like other Allow* methods in the observer
  • Loading branch information
darkdh authored Oct 4, 2018
2 parents 6ad02d0 + c18663a commit b67288b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions chromium_src/chrome/renderer/content_settings_observer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,13 @@ bool ContentSettingsObserver::AllowScript(bool enabled_per_settings) {
// IsWhitelistedForContentSettings(); if there is only the default rule
// allowing all scripts, it's quicker this way.
bool allow = true;
if (content_setting_rules_) {
ContentSetting setting = GetContentSettingFromRules(
content_setting_rules_->script_rules, frame,
url::Origin(frame->GetDocument().GetSecurityOrigin()).GetURL());
allow = setting != CONTENT_SETTING_BLOCK;
if (content_settings_manager_->content_settings()) {
allow =
content_settings_manager_->GetSetting(
ContentSettingsManager::GetOriginOrURL(render_frame()->GetWebFrame()),
url::Origin(frame->GetDocument().GetSecurityOrigin()).GetURL(),
"javascript",
allow) != CONTENT_SETTING_BLOCK;
}
allow = allow || IsWhitelistedForContentSettings();

Expand Down

0 comments on commit b67288b

Please sign in to comment.