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:
parent
ff24caf798
commit
9e53112ee1
2 changed files with 22 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue