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;
}
}
版权属于:区块链中文技术社区 / 转载原创者
本文链接:https://bcskill.com/index.php/archives/691.html
相关技术文章仅限于相关区块链底层技术研究,禁止用于非法用途,后果自负!本站严格遵守一切相关法律政策!