Chromium Code Reviews| Index: chrome/browser/extensions/active_tab_permission_granter.cc |
| diff --git a/chrome/browser/extensions/active_tab_permission_granter.cc b/chrome/browser/extensions/active_tab_permission_granter.cc |
| index 608eaa171c31549c8176b39df6c3d9ebb9ef7a7e..6e25db1006c10f07b0b0119a2685e735dd485eaa 100644 |
| --- a/chrome/browser/extensions/active_tab_permission_granter.cc |
| +++ b/chrome/browser/extensions/active_tab_permission_granter.cc |
| @@ -11,6 +11,7 @@ |
| #include "content/public/browser/web_contents.h" |
| #include "extensions/browser/extension_registry.h" |
| #include "extensions/common/extension_messages.h" |
| +#include "extensions/common/feature_switch.h" |
| #include "extensions/common/permissions/permission_set.h" |
| #include "extensions/common/permissions/permissions_data.h" |
| #include "extensions/common/user_script.h" |
| @@ -90,7 +91,15 @@ void ActiveTabPermissionGranter::DidNavigateMainFrame( |
| if (details.is_in_page) |
| return; |
| DCHECK(details.is_main_frame); // important: sub-frames don't get granted! |
| - ClearActiveExtensionsAndNotify(); |
| + |
| + // See http://crbug.com/404243 for why we do this. Only do this when the |
| + // script-require-action flag is on, since it's not clear it's generally a |
| + // good idea. However, the scripts-require-action feature is all-but unusable |
| + // without this behaviour. |
| + if (details.previous_url.GetOrigin() != details.entry->GetURL().GetOrigin() || |
|
Devlin
2014/08/15 21:24:00
I seem to recall that NavigationEntries are one of
not at google - send to devlin
2014/08/15 21:38:29
Ah yes, good point. Fixed.
|
| + !FeatureSwitch::scripts_require_action()->IsEnabled()) { |
| + ClearActiveExtensionsAndNotify(); |
| + } |
| } |
| void ActiveTabPermissionGranter::WebContentsDestroyed() { |