Popup dimensions: now in storage

This commit is contained in:
ikipatang 2017-11-30 13:33:54 +01:00
parent 67e347b652
commit 6e23d4f3a5
2 changed files with 10 additions and 6 deletions

View file

@ -1,15 +1,17 @@
/**
* Open the given url in a popup
* @param {string} url -
* @return {void} -
* @param {string} url -
* @param {number} width -
* @param {number} height -
* @return {void} -
*/
function openInPopup(url) {
function openInPopup(url, width, height) {
browser.windows.create({
url,
type: 'popup',
allowScriptsToClose: true,
height: 600,
width: 900,
width,
height,
});
}
@ -26,7 +28,7 @@ function shareCurrentTab(tab) {
return;
}
const shareUrl = `${storage.url}?post=${encodeURIComponent(url)}&title=${encodeURIComponent(title)}&source=bookmarklet`;
openInPopup(shareUrl);
openInPopup(shareUrl, storage.popupWidth, storage.popupHeight);
});
}

View file

@ -4,6 +4,8 @@ Default settings. Initialize storage to these values.
var storage = {
url: '',
pageAction: false,
popupWidth: 900,
popupHeight: 600,
}
/*