mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: add new fuse to treat file: identically to browsers (#40372)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user