feat: add new fuse to treat file: identically to browsers (#40372)
This commit is contained in:
parent
0f68d845f9
commit
d504d150ef
7 changed files with 63 additions and 9 deletions
|
@ -19,6 +19,7 @@
|
|||
#include "content/public/renderer/render_frame.h"
|
||||
#include "content/public/renderer/render_thread.h"
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
#include "electron/fuses.h"
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
#include "shell/browser/api/electron_api_protocol.h"
|
||||
#include "shell/common/api/electron_api_native_image.h"
|
||||
|
@ -277,8 +278,10 @@ void RendererClientBase::RenderThreadStarted() {
|
|||
|
||||
// Allow file scheme to handle service worker by default.
|
||||
// FIXME(zcbenz): Can this be moved elsewhere?
|
||||
blink::WebSecurityPolicy::RegisterURLSchemeAsAllowingServiceWorkers("file");
|
||||
blink::SchemeRegistry::RegisterURLSchemeAsSupportingFetchAPI("file");
|
||||
if (electron::fuses::IsGrantFileProtocolExtraPrivilegesEnabled()) {
|
||||
blink::WebSecurityPolicy::RegisterURLSchemeAsAllowingServiceWorkers("file");
|
||||
blink::SchemeRegistry::RegisterURLSchemeAsSupportingFetchAPI("file");
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// Set ApplicationUserModelID in renderer process.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue