Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(980)

Unified Diff: extensions/renderer/dispatcher.cc

Issue 1310953003: Enable the Fetch API for extensions which service workers are supported. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/dispatcher.cc
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc
index 34324e2be1bf10a27c375337e720fd03c5a85029..f65cf4df96955bd039811c1abff7a239e538ba40 100644
--- a/extensions/renderer/dispatcher.cc
+++ b/extensions/renderer/dispatcher.cc
@@ -1567,12 +1567,15 @@ void Dispatcher::RequireGuestViewModules(ScriptContext* context) {
}
void Dispatcher::AddChannelSpecificFeatures() {
- // chrome-extension: resources should be allowed to register a Service Worker.
if (FeatureProvider::GetBehaviorFeature(BehaviorFeature::kServiceWorker)
->IsAvailableToEnvironment()
- .is_available())
- WebSecurityPolicy::registerURLSchemeAsAllowingServiceWorkers(
- WebString::fromUTF8(kExtensionScheme));
+ .is_available()) {
+ // If chrome-extension: is allowed to register service workers, register it
+ // as an allowed scheme for both service workers and the Fetch API.
+ WebString scheme = WebString::fromUTF8(kExtensionScheme);
+ WebSecurityPolicy::registerURLSchemeAsAllowingServiceWorkers(scheme);
+ WebSecurityPolicy::registerURLSchemeAsSupportingFetchAPI(scheme);
+ }
}
} // namespace extensions
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698