ff bug workaround for simple editor window
This commit is contained in:
parent
a0fc147015
commit
05e1455280
|
@ -48,16 +48,20 @@ Object.assign(API, {
|
||||||
}} params
|
}} params
|
||||||
* @returns {Promise<chrome.tabs.Tab>}
|
* @returns {Promise<chrome.tabs.Tab>}
|
||||||
*/
|
*/
|
||||||
openEditor(params) {
|
async openEditor(params) {
|
||||||
const u = new URL(chrome.runtime.getURL('edit.html'));
|
const u = new URL(chrome.runtime.getURL('edit.html'));
|
||||||
u.search = new URLSearchParams(params);
|
u.search = new URLSearchParams(params);
|
||||||
return openURL({
|
const wnd = prefs.get('openEditInWindow');
|
||||||
|
const wndPos = wnd && prefs.get('windowPosition');
|
||||||
|
const wndBase = wnd && prefs.get('openEditInWindow.popup') ? {type: 'popup'} : {};
|
||||||
|
const ffBug = wnd && FIREFOX; // https://bugzil.la/1271047
|
||||||
|
const tab = await openURL({
|
||||||
url: `${u}`,
|
url: `${u}`,
|
||||||
currentWindow: null,
|
currentWindow: null,
|
||||||
newWindow: prefs.get('openEditInWindow') && Object.assign({},
|
newWindow: Object.assign(wndBase, !ffBug && wndPos),
|
||||||
prefs.get('openEditInWindow.popup') && {type: 'popup'},
|
|
||||||
prefs.get('windowPosition')),
|
|
||||||
});
|
});
|
||||||
|
if (ffBug) await browser.windows.update(tab.windowId, wndPos);
|
||||||
|
return tab;
|
||||||
},
|
},
|
||||||
|
|
||||||
/** @returns {Promise<chrome.tabs.Tab>} */
|
/** @returns {Promise<chrome.tabs.Tab>} */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user