ScatterWebExtension popup window
const getPopup = async () => {
try {
const url = apis.runtime.getURL('/prompt.html');
// Notifications get bound differently depending on browser
// as Firefox does not support opening windows from background.
if(typeof browser !== 'undefined') {
const created = await apis.windows.create({
url,
height,
width,
type:'popup'
});
window.notification = notification;
return created;
}
else {
const win = window.open(url, 'ScatterPrompt', `width=${width},height=${height},resizable=0,top=${middleY},left=${middleX},titlebar=0`);
win.data = notification;
openWindow = win;
return win;
}
} catch (e) {
console.log('notification error', e);
return null;
}
}
当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »