mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
fix(extensions): enable WebSQL in background pages (#24798)
* fix(extensions): enable WebSQL in background pages * fix: apply suggestions * fix: remove duplicate include * fix: remove trailing spaces
This commit is contained in:
@@ -772,6 +772,16 @@ void ElectronBrowserClient::AppendExtraCommandLineSwitches(
|
||||
command_line->AppendSwitch("profile-electron-init");
|
||||
}
|
||||
|
||||
// Extension background pages don't have WebContentsPreferences, but they
|
||||
// support WebSQL by default.
|
||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
||||
content::RenderProcessHost* process =
|
||||
content::RenderProcessHost::FromID(process_id);
|
||||
if (extensions::ProcessMap::Get(process->GetBrowserContext())
|
||||
->Contains(process_id))
|
||||
command_line->AppendSwitch(switches::kEnableWebSQL);
|
||||
#endif
|
||||
|
||||
content::WebContents* web_contents =
|
||||
GetWebContentsFromProcessID(process_id);
|
||||
if (web_contents) {
|
||||
|
||||
Reference in New Issue
Block a user