diff options
author | hristoterezov <hristo@jitsi.org> | 2017-08-04 16:15:22 +0300 |
---|---|---|
committer | hristoterezov <hristo@jitsi.org> | 2017-08-04 16:15:22 +0300 |
commit | f443eec56f7b18b7b32c080f9548ebee0c270669 (patch) | |
tree | 1a31ea6b50e9985b629bcfb9be26269e71643111 /main.js | |
parent | 2fe1b9acd44ceffab13415f648a6550f88791267 (diff) |
feat(alwaysontop): Implement
Diffstat (limited to 'main.js')
-rw-r--r-- | main.js | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -4,6 +4,10 @@ const electron = require("electron"); const APP = electron.app; const BrowserWindow = electron.BrowserWindow; +const { + setupAlwaysOnTopMain +} = require("jitsi-meet-electron-utils"); + const path = require("path"); const url = require("url"); @@ -31,7 +35,10 @@ const jitsiMeetWindowOptions = { height: 600, minWidth: 800, minHeight: 600, - titleBarStyle: 'hidden' + titleBarStyle: 'hidden', + webPreferences: { + nativeWindowOpen: true + } }; /** @@ -69,11 +76,15 @@ function createJitsiMeetWindow () { jitsiMeetWindow = new BrowserWindow(jitsiMeetWindowOptions); jitsiMeetWindow.loadURL(indexURL); - jitsiMeetWindow.webContents.on('new-window', function(event, url) { - event.preventDefault(); - electron.shell.openExternal(url); + jitsiMeetWindow.webContents.on('new-window', (event, url, frameName) => { + if (frameName !== 'AlwaysOnTop') { + event.preventDefault(); + electron.shell.openExternal(url); + } }); + setupAlwaysOnTopMain(jitsiMeetWindow); + jitsiMeetWindow.on("closed", () => { jitsiMeetWindow = null; }); |