fix: disallow loading extensions in temp sessions (#22090)
* fix: disallow loading extensions in temp sessions * docs
This commit is contained in:
parent
c2cd588e70
commit
af631f8204
4 changed files with 25 additions and 8 deletions
|
@ -613,6 +613,11 @@ v8::Local<v8::Promise> Session::LoadExtension(
|
|||
const base::FilePath& extension_path) {
|
||||
gin_helper::Promise<const extensions::Extension*> promise(isolate());
|
||||
v8::Local<v8::Promise> handle = promise.GetHandle();
|
||||
if (browser_context()->IsOffTheRecord()) {
|
||||
promise.RejectWithErrorMessage(
|
||||
"Extensions cannot be loaded in a temporary session");
|
||||
return handle;
|
||||
}
|
||||
|
||||
auto* extension_system = static_cast<extensions::ElectronExtensionSystem*>(
|
||||
extensions::ExtensionSystem::Get(browser_context()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue