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

Issue: 15232 AllowScript should use atom::ContentSettingsManager like other Allow* methods in the observer #651

Merged
merged 1 commit into from
Oct 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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