mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
refactor deprecated window event handler
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
cb80998a5b
commit
7c80ea33e4
@ -109,10 +109,6 @@ export class WindowManager extends Singleton {
|
||||
app.dock?.hide(); // hide icon in dock (mac-os)
|
||||
})
|
||||
.webContents
|
||||
.on("new-window", (event, url) => {
|
||||
event.preventDefault();
|
||||
shell.openExternal(url);
|
||||
})
|
||||
.on("dom-ready", () => {
|
||||
appEventBus.emit({ name: "app", action: "dom-ready" });
|
||||
})
|
||||
@ -150,6 +146,10 @@ export class WindowManager extends Singleton {
|
||||
|
||||
// Always disable Node.js integration for all webviews
|
||||
webPreferences.nodeIntegration = false;
|
||||
}).setWindowOpenHandler((details) => {
|
||||
shell.openExternal(details.url);
|
||||
|
||||
return { action: "deny" };
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user