mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: add handling for non-absolute extension paths (#25074)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
This commit is contained in:
@@ -683,6 +683,13 @@ v8::Local<v8::Promise> Session::LoadExtension(
|
||||
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
||||
gin_helper::Promise<const extensions::Extension*> promise(isolate);
|
||||
v8::Local<v8::Promise> handle = promise.GetHandle();
|
||||
|
||||
if (!extension_path.IsAbsolute()) {
|
||||
promise.RejectWithErrorMessage(
|
||||
"The path to the extension in 'loadExtension' must be absolute");
|
||||
return handle;
|
||||
}
|
||||
|
||||
if (browser_context()->IsOffTheRecord()) {
|
||||
promise.RejectWithErrorMessage(
|
||||
"Extensions cannot be loaded in a temporary session");
|
||||
|
||||
Reference in New Issue
Block a user