diff --git a/package.json b/package.json index 67cddf5b..6b179811 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app", - "version": "5.6.17", + "version": "5.6.18", "description": "", "author": "", "license": "ISC", diff --git a/src/target/extension/background/contextMenus.js b/src/target/extension/background/contextMenus.js index d5841d8a..284abce9 100644 --- a/src/target/extension/background/contextMenus.js +++ b/src/target/extension/background/contextMenus.js @@ -24,10 +24,10 @@ async function onClicked({ menuItemId, pageUrl, srcUrl, linkUrl }, { windowId }) return open('/extension/tabs/-1') case 'open_app': - return open('/', { width: 1280, height: 800, autoClose: false }) + return open('/', { width: 1280, height: 800 }) case 'settings': - return open('/settings', { width: 800, height: 700, autoClose: false }) + return open('/settings', { width: 800, height: 700 }) case 'execute_side_panel': if (browser.sidePanel) diff --git a/src/target/extension/background/popup.js b/src/target/extension/background/popup.js index d83812e9..a2006f92 100644 --- a/src/target/extension/background/popup.js +++ b/src/target/extension/background/popup.js @@ -5,15 +5,14 @@ import { environment } from '~target' const base = environment.includes('safari') ? 'https://app.raindrop.io' : '/index.html#' -const winIds = new Set() -export async function open(path, { width = 420, height = 600, autoClose = true } = {}) { +export async function open(path, { width = 420, height = 600 } = {}) { let origin = { left: 0, top: 0, width: 0, height: 0 } try{ origin = await browser.windows.getCurrent() } catch(_) {} - const { id } = await browser.windows.create({ + return await browser.windows.create({ url: `${base}${path}`, type: 'popup', @@ -23,22 +22,7 @@ export async function open(path, { width = 420, height = 600, autoClose = true } left: parseInt(origin.left + (origin.width/2) - (width/2)), top: parseInt(origin.top + (origin.height/2) - (height/2)) }) - - //delay autoclose on blur, otherwise buggy on arch linux - if (autoClose) - setTimeout(() => { winIds.add(id) }, 100) -} - -/* Close all open popups when focused window change */ -function onFocusChanged(id) { - for(const close of winIds) - if (close != id) { - try { browser.windows.remove(close) } catch(e) {} - winIds.delete(close) - } } export default function() { - browser.windows.onFocusChanged.removeListener(onFocusChanged) - browser.windows.onFocusChanged.addListener(onFocusChanged) } \ No newline at end of file