fix: webRequest module should work with file:// protocol (#22903)
* fix: override file:// instead of intercepting * test: webRequest module should work with file:// * fix: service work with file:// url * fix: original_response_headers can be null * fix: only register file:// when necessary
This commit is contained in:
parent
bac1c7f532
commit
e6f2605ad0
6 changed files with 101 additions and 7 deletions
|
@ -825,8 +825,11 @@ void ProxyingURLLoaderFactory::CreateLoaderAndStart(
|
|||
return;
|
||||
}
|
||||
|
||||
// Intercept file:// protocol to support asar archives.
|
||||
if (request.url.SchemeIsFile()) {
|
||||
// The loader of ServiceWorker forbids loading scripts from file:// URLs, and
|
||||
// Chromium does not provide a way to override this behavior. So in order to
|
||||
// make ServiceWorker work with file:// URLs, we have to intercept its
|
||||
// requests here.
|
||||
if (IsForServiceWorkerScript() && request.url.SchemeIsFile()) {
|
||||
asar::CreateAsarURLLoader(request, std::move(loader), std::move(client),
|
||||
new net::HttpResponseHeaders(""));
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue