mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: savePage throw on relative paths (#33019)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -2353,6 +2353,11 @@ v8::Local<v8::Promise> WebContents::SavePage(
|
||||
gin_helper::Promise<void> promise(isolate);
|
||||
v8::Local<v8::Promise> handle = promise.GetHandle();
|
||||
|
||||
if (!full_file_path.IsAbsolute()) {
|
||||
promise.RejectWithErrorMessage("Path must be absolute");
|
||||
return handle;
|
||||
}
|
||||
|
||||
auto* handler = new SavePageHandler(web_contents(), std::move(promise));
|
||||
handler->Handle(full_file_path, save_type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user