From 0da9e9ed9dde45e41cc55e7b618be291bab7bc74 Mon Sep 17 00:00:00 2001 From: ettoolong Date: Sun, 17 Dec 2017 22:43:52 +0800 Subject: [PATCH 01/14] 1. Fix bug. --- background.js | 2 +- manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/background.js b/background.js index a7518d0..a3a701e 100644 --- a/background.js +++ b/background.js @@ -94,7 +94,7 @@ const createContextMenu = (mode) => { }; const resetContextMenu = (type) => { - if (preferences.moveThisTab) { + if (preferences.moveThisPage) { createContextMenu(type); } else { if(menu_moveThisPage !== null) { diff --git a/manifest.json b/manifest.json index 7c8ee69..8f2bb9d 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "description": "__MSG_extDescription__", "manifest_version": 2, "name": "__MSG_extName__", - "version": "0.0.3", + "version": "0.0.4", "homepage_url": "https://github.com/ettoolong/PopupWindow", "icons": { "16": "icon/icon.svg", From a4604d7a040b97628c67c3ca93bc441caade9e11 Mon Sep 17 00:00:00 2001 From: ettoolong Date: Fri, 9 Feb 2018 21:22:17 +0800 Subject: [PATCH 02/14] 1. Add pop-up window width/height setting. --- _locales/en/messages.json | 8 ++++++++ _locales/zh_TW/messages.json | 8 ++++++++ background.js | 9 ++++++--- manifest.json | 2 +- options.html | 9 +++++++++ options.js | 8 ++++++++ 6 files changed, 40 insertions(+), 4 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index c6bfc5d..ac72513 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -59,6 +59,14 @@ "message": "Bottom right corner", "description": "" }, + "windowWidth": { + "message": "Default pop-up window width", + "description": "" + }, + "windowHeight": { + "message": "Default pop-up window height", + "description": "" + }, "iconColor": { "message": "Toolbar button icon color", "description": "" diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 9a82555..8ddbbea 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -59,6 +59,14 @@ "message": "右下角", "description": "" }, + "windowWidth": { + "message": "預設視窗寬度", + "description": "" + }, + "windowHeight": { + "message": "預設視窗高度", + "description": "" + }, "iconColor": { "message": "工具列圖示顏色", "description": "" diff --git a/background.js b/background.js index a3a701e..4eefbd8 100644 --- a/background.js +++ b/background.js @@ -1,10 +1,12 @@ let defaultPreference = { defaultPosition: 0, + windowWidth: 500, + windowHeight: 400, openThisLink: true, moveThisPage: true, moveThisTab: false, iconColor: 0, //0:black, 1:white - version: 2 + version: 3 }; let preferences = {}; let menu_openThisLink = null; @@ -61,6 +63,7 @@ const loadPreference = () => { } } if(needUpdate) { + update.version = defaultPreference.version; chrome.storage.local.set(update); } } @@ -169,8 +172,8 @@ const setBrowserActionIcon = () => { const popupWindow = (tab, targetUrl) => { let screen = window.screen; - let width = 500; - let height = 400; + let width = preferences.windowWidth; + let height = preferences.windowHeight; let top = screen.availTop !== undefined ? screen.availTop: screen.top; let left = screen.availLeft !== undefined ? screen.availLeft: screen.left; diff --git a/manifest.json b/manifest.json index 8f2bb9d..8f59502 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "description": "__MSG_extDescription__", "manifest_version": 2, "name": "__MSG_extName__", - "version": "0.0.4", + "version": "0.0.5", "homepage_url": "https://github.com/ettoolong/PopupWindow", "icons": { "16": "icon/icon.svg", diff --git a/options.html b/options.html index 35fa5c9..fef5169 100644 --- a/options.html +++ b/options.html @@ -42,6 +42,15 @@ +
+ + +
+
+ + +
+
diff --git a/options.js b/options.js index 8c0a877..a6c219b 100644 --- a/options.js +++ b/options.js @@ -20,6 +20,11 @@ const handleVelueChange = id => { saveToPreference(id, parseInt(elem.value)); }); } + else if(elemType === 'number') { + elem.addEventListener('input', event => { + saveToPreference(id, parseInt(elem.value)); + }); + } else if(elemType === 'radioGroup') { let radios = Array.from(elem.querySelectorAll('input[name='+id+']')); for(let radio of radios) { @@ -48,6 +53,9 @@ const setValueToElem = (id, value) => { } } } + else if(elemType === 'number') { + elem.value = value; + } else if(elemType === 'radioGroup') { let radios = Array.from(elem.querySelectorAll('input[name='+id+']')); for(let radio of radios) { From a6ae2785279eeb26c542fd34b3e7f6349cb1b195 Mon Sep 17 00:00:00 2001 From: ettoolong Date: Sun, 4 Mar 2018 13:17:41 +0800 Subject: [PATCH 03/14] 1. Beautify code. --- _locales/en/messages.json | 134 +++++++++++++++++------------------ _locales/zh_TW/messages.json | 132 +++++++++++++++++----------------- 2 files changed, 133 insertions(+), 133 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index ac72513..fe4591c 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1,82 +1,82 @@ { - "extName": { - "message": "Popup window", - "description": "" - }, - "extDescription": { - "message": "Move tab to standalone window, without tabs bar, navigation bar and bookmark bar UI.", - "description": "" - }, - "optionPageTitle": { - "message": "Pop-up window Preferences", - "description": "" - }, + "extName": { + "message": "Popup window", + "description": "" + }, + "extDescription": { + "message": "Move tab to standalone window, without tabs bar, navigation bar and bookmark bar UI.", + "description": "" + }, + "optionPageTitle": { + "message": "Pop-up window Preferences", + "description": "" + }, "actionButtonTitle": { - "message": "Move current tab to pop-up window", - "description": "" + "message": "Move current tab to pop-up window", + "description": "" }, "contextMenuItems": { - "message": "Context menu items:", - "description": "" - }, + "message": "Context menu items:", + "description": "" + }, "tabMenu": { - "message": "Tab menu item", - "description": "" - }, - "openThisLink": { - "message": "Open this link in pop-up window", - "description": "" - }, - "moveThisPage": { - "message": "pop-up/merge current page", - "description": "" - }, - "moveThisTab": { - "message": "Move current tab to pop-up window", - "description": "" - }, - "defaultPosition": { - "message": "Default pop-up window position", - "description": "" - }, + "message": "Tab menu item", + "description": "" + }, + "openThisLink": { + "message": "Open this link in pop-up window", + "description": "" + }, + "moveThisPage": { + "message": "pop-up/merge current page", + "description": "" + }, + "moveThisTab": { + "message": "Move current tab to pop-up window", + "description": "" + }, + "defaultPosition": { + "message": "Default pop-up window position", + "description": "" + }, "center": { - "message": "Center", - "description": "" + "message": "Center", + "description": "" }, "topLeft": { - "message": "Top left corner", - "description": "" + "message": "Top left corner", + "description": "" }, "bottomLeft": { - "message": "Bottom left corner", - "description": "" + "message": "Bottom left corner", + "description": "" }, "topRight": { - "message": "Top right corner", - "description": "" + "message": "Top right corner", + "description": "" }, "bottomRight": { - "message": "Bottom right corner", - "description": "" - }, - "windowWidth": { - "message": "Default pop-up window width", - "description": "" - }, - "windowHeight": { - "message": "Default pop-up window height", - "description": "" - }, - "iconColor": { - "message": "Toolbar button icon color", - "description": "" - }, - "iconColorBlack": { - "message": "Black", - "description": "" - }, - "iconColorWhite": { - "message": "White", - "description": "" - } + "message": "Bottom right corner", + "description": "" + }, + "windowWidth": { + "message": "Default pop-up window width", + "description": "" + }, + "windowHeight": { + "message": "Default pop-up window height", + "description": "" + }, + "iconColor": { + "message": "Toolbar button icon color", + "description": "" + }, + "iconColorBlack": { + "message": "Black", + "description": "" + }, + "iconColorWhite": { + "message": "White", + "description": "" + } } diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 8ddbbea..d119af4 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -1,82 +1,82 @@ { - "extName": { - "message": "Popup window", - "description": "" - }, - "extDescription": { - "message": "將 Tab 彈出至獨立視窗,去除頁籤列、網址列和書籤列等介面", - "description": "" - }, - "optionPageTitle": { - "message": "Popup window 設定頁", - "description": "" + "extName": { + "message": "Popup window", + "description": "" + }, + "extDescription": { + "message": "將 Tab 彈出至獨立視窗,去除頁籤列、網址列和書籤列等介面", + "description": "" + }, + "optionPageTitle": { + "message": "Popup window 設定頁", + "description": "" }, "actionButtonTitle": { - "message": "將目前分頁彈出至獨立視窗", - "description": "" + "message": "將目前分頁彈出至獨立視窗", + "description": "" }, "contextMenuItems": { - "message": "右鍵選單項目:", - "description": "" - }, + "message": "右鍵選單項目:", + "description": "" + }, "tabMenu": { - "message": "分頁右鍵選單", - "description": "" - }, - "openThisLink": { - "message": "將此連結彈出至獨立視窗", - "description": "" - }, - "moveThisPage": { - "message": "彈出/合併 目前頁面", - "description": "" - }, - "moveThisTab": { - "message": "將目前分頁彈出至獨立視窗", - "description": "" - }, - "defaultPosition": { - "message": "預設視窗位置", - "description": "" - }, + "message": "分頁右鍵選單", + "description": "" + }, + "openThisLink": { + "message": "將此連結彈出至獨立視窗", + "description": "" + }, + "moveThisPage": { + "message": "彈出/合併 目前頁面", + "description": "" + }, + "moveThisTab": { + "message": "將目前分頁彈出至獨立視窗", + "description": "" + }, + "defaultPosition": { + "message": "預設視窗位置", + "description": "" + }, "center": { - "message": "螢幕中央", - "description": "" + "message": "螢幕中央", + "description": "" }, "topLeft": { - "message": "左上角", - "description": "" + "message": "左上角", + "description": "" }, "bottomLeft": { - "message": "左下角", - "description": "" + "message": "左下角", + "description": "" }, "topRight": { - "message": "右上角", - "description": "" + "message": "右上角", + "description": "" }, "bottomRight": { - "message": "右下角", - "description": "" - }, - "windowWidth": { - "message": "預設視窗寬度", - "description": "" - }, - "windowHeight": { - "message": "預設視窗高度", - "description": "" - }, - "iconColor": { - "message": "工具列圖示顏色", - "description": "" - }, - "iconColorBlack": { - "message": "黑", - "description": "" - }, - "iconColorWhite": { - "message": "白", - "description": "" - } + "message": "右下角", + "description": "" + }, + "windowWidth": { + "message": "預設視窗寬度", + "description": "" + }, + "windowHeight": { + "message": "預設視窗高度", + "description": "" + }, + "iconColor": { + "message": "工具列圖示顏色", + "description": "" + }, + "iconColorBlack": { + "message": "黑", + "description": "" + }, + "iconColorWhite": { + "message": "白", + "description": "" + } } From 79d8c70db9316e5438ac747029bf8fb1ade04709 Mon Sep 17 00:00:00 2001 From: ettoolong Date: Wed, 18 Apr 2018 11:31:28 +0800 Subject: [PATCH 04/14] 1. Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index eae923a..a58794a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # PopupWindow Firefox add-on, move tab to standalone window, without tabs bar, navigation bar and bookmark bar UI. + +* Install Firefox add-on: [addons.mozilla.org](https://addons.mozilla.org/zh-TW/firefox/addon/popup-window/) +* Install Chrome extension: [Chrome Web Store](https://chrome.google.com/webstore/detail/popup-window/nnlippelgfbglbhiccffmnmlnhmbjjpe) From d970c6002dd46cabfa6421ca6271b77567aaffa8 Mon Sep 17 00:00:00 2001 From: ettoolong Date: Fri, 14 Sep 2018 19:19:37 +0800 Subject: [PATCH 05/14] 1. Support ack message. --- background.js | 3 +++ manifest.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/background.js b/background.js index 4eefbd8..56c3426 100644 --- a/background.js +++ b/background.js @@ -316,6 +316,9 @@ const messageHandler = (message, sender, sendResponse) => { popupWindow(tab); }); } + else if(message.action === 'ack') { + sendResponse({result:'ok'}); + } }; chrome.runtime.onMessage.addListener(messageHandler); diff --git a/manifest.json b/manifest.json index 8f59502..1b93208 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "description": "__MSG_extDescription__", "manifest_version": 2, "name": "__MSG_extName__", - "version": "0.0.5", + "version": "0.0.6", "homepage_url": "https://github.com/ettoolong/PopupWindow", "icons": { "16": "icon/icon.svg", From 4667539d0f122793d4b09242fc5f3b7fc395a5f3 Mon Sep 17 00:00:00 2001 From: ettoolong Date: Thu, 27 Sep 2018 21:00:03 +0800 Subject: [PATCH 06/14] 1. Add options for custom window position. --- _locales/en/messages.json | 12 ++++++++++++ _locales/zh_TW/messages.json | 12 ++++++++++++ background.js | 23 ++++++++++++++++++++--- manifest.json | 2 +- options.css | 17 +++++++++++++++++ options.html | 5 +++++ options.js | 22 ++++++++++++++++++++++ 7 files changed, 89 insertions(+), 4 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index fe4591c..992527a 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -59,6 +59,18 @@ "message": "Bottom right corner", "description": "" }, + "customPosition": { + "message": "Custom position", + "description": "" + }, + "windowPositionLeft": { + "message": "Left", + "description": "" + }, + "windowPositionTop": { + "message": "Top", + "description": "" + }, "windowWidth": { "message": "Default pop-up window width", "description": "" diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index d119af4..f13f5f5 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -59,6 +59,18 @@ "message": "右下角", "description": "" }, + "customPosition": { + "message": "自訂位置", + "description": "" + }, + "windowPositionLeft": { + "message": "左", + "description": "" + }, + "windowPositionTop": { + "message": "上", + "description": "" + }, "windowWidth": { "message": "預設視窗寬度", "description": "" diff --git a/background.js b/background.js index 56c3426..9addcc1 100644 --- a/background.js +++ b/background.js @@ -1,12 +1,14 @@ let defaultPreference = { defaultPosition: 0, + windowPositionLeft: 0, + windowPositionTop: 0, windowWidth: 500, windowHeight: 400, openThisLink: true, moveThisPage: true, moveThisTab: false, iconColor: 0, //0:black, 1:white - version: 3 + version: 4 }; let preferences = {}; let menu_openThisLink = null; @@ -170,7 +172,7 @@ const setBrowserActionIcon = () => { } }; -const popupWindow = (tab, targetUrl) => { +const popupWindow = (tab, targetUrl, winTop, winLeft) => { let screen = window.screen; let width = preferences.windowWidth; let height = preferences.windowHeight; @@ -185,6 +187,10 @@ const popupWindow = (tab, targetUrl) => { top = sTop + Math.round((sHeight - height)/2); left = sLeft + Math.round((sWidth - width)/2); } + else if (preferences.defaultPosition === 5) { + top = preferences.windowPositionTop; + left = preferences.windowPositionLeft; + } else { if (preferences.defaultPosition === 2 || preferences.defaultPosition === 4) { top = sTop + sHeight - height; @@ -197,6 +203,13 @@ const popupWindow = (tab, targetUrl) => { left = sLeft; } } + if(winTop) { + top = winTop; + } + if(winLeft) { + left = winLeft; + } + let setting = { type: 'popup', top: top, @@ -313,7 +326,11 @@ window.addEventListener('DOMContentLoaded', event => { const messageHandler = (message, sender, sendResponse) => { if(message.action === 'popupWindow') { chrome.tabs.get(message.tabId, tab => { - popupWindow(tab); + if(message.left && message.top) { + popupWindow(tab, null, message.left, message.top); + } else { + popupWindow(tab); + } }); } else if(message.action === 'ack') { diff --git a/manifest.json b/manifest.json index 1b93208..1ced42a 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "description": "__MSG_extDescription__", "manifest_version": 2, "name": "__MSG_extName__", - "version": "0.0.6", + "version": "0.0.7", "homepage_url": "https://github.com/ettoolong/PopupWindow", "icons": { "16": "icon/icon.svg", diff --git a/options.css b/options.css index f787510..2c49a30 100644 --- a/options.css +++ b/options.css @@ -6,6 +6,7 @@ div.col { .itemDiv { display: block; margin-top:4px; + min-height: 24px; } .itemLabel { @@ -18,3 +19,19 @@ select.itemInput { width: 250px; margin-left:12px; } + +input.windowPosition { + width:70px; +} + +label.windowPosition { + margin-left: 6px; +} + +.hidden { + display: none; +} + +.show { + display: inline-block; +} diff --git a/options.html b/options.html index fef5169..0c74e85 100644 --- a/options.html +++ b/options.html @@ -39,7 +39,12 @@ + + + + +
diff --git a/options.js b/options.js index a6c219b..5c23d01 100644 --- a/options.js +++ b/options.js @@ -68,6 +68,23 @@ const setValueToElem = (id, value) => { } }; +const onDefaultPositionChange = () => { + let defaultPosition = document.getElementById('defaultPosition'); + let elems = Array.from(document.querySelectorAll('.windowPosition')); + + if(defaultPosition.value === '5') { + elems.forEach(tag => { + tag.classList.add('show'); + tag.classList.remove('hidden'); + }); + } else { + elems.forEach(tag => { + tag.classList.add('hidden'); + tag.classList.remove('show'); + }); + } +} + const init = preferences => { currentPrefs = preferences; for(let p in preferences) { @@ -78,6 +95,11 @@ const init = preferences => { l10nTags.forEach(tag => { tag.textContent = chrome.i18n.getMessage(tag.getAttribute('data-l10n-id')); }); + let defaultPosition = document.getElementById('defaultPosition'); + defaultPosition.addEventListener('change', event=>{ + onDefaultPositionChange(); + }); + onDefaultPositionChange(); }; window.addEventListener('load', event => { From 875c3f60f99cede6da14ed75712ca161be5cb39b Mon Sep 17 00:00:00 2001 From: ettoolong Date: Tue, 7 May 2019 17:15:51 +0800 Subject: [PATCH 07/14] 1. Support keyboard shortcut. --- _locales/en/messages.json | 4 ++++ _locales/zh_TW/messages.json | 4 ++++ background.js | 19 +++++++++++++++++++ manifest.json | 9 +++++++-- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 992527a..9fbb5ed 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -90,5 +90,9 @@ "iconColorWhite": { "message": "White", "description": "" + }, + "execute": { + "message": "Pop-up/Merge page", + "description": "" } } diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index f13f5f5..5268bb2 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -90,5 +90,9 @@ "iconColorWhite": { "message": "白", "description": "" + }, + "execute": { + "message": "彈出/合併 頁面", + "description": "" } } diff --git a/background.js b/background.js index 9addcc1..f637b1d 100644 --- a/background.js +++ b/background.js @@ -323,6 +323,25 @@ window.addEventListener('DOMContentLoaded', event => { loadPreference(); }); +chrome.commands.onCommand.addListener(command => { + if (command === "popupWindow") { + chrome.windows.getCurrent(windowInfo => { + chrome.tabs.query({active: true, currentWindow: true}, tabs => { + if ((typeof tabs !== 'undefined') && (tabs.length > 0)) { + let tab = tabs[0]; + if(windowInfo.type === 'popup') { + let popup = popupMapping.get(windowInfo.id); + mergeWindow(tab, popup ? popup.originalWindowId: null); + } + else { + popupWindow(tab); + } + } + }); + }); + } +}); + const messageHandler = (message, sender, sendResponse) => { if(message.action === 'popupWindow') { chrome.tabs.get(message.tabId, tab => { diff --git a/manifest.json b/manifest.json index 1ced42a..277a68a 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "description": "__MSG_extDescription__", "manifest_version": 2, "name": "__MSG_extName__", - "version": "0.0.7", + "version": "0.0.8", "homepage_url": "https://github.com/ettoolong/PopupWindow", "icons": { "16": "icon/icon.svg", @@ -14,7 +14,7 @@ "applications": { "gecko": { "id": "PopupWindow@ettoolong", - "strict_min_version": "53.0" + "strict_min_version": "66.0" } }, "developer": { @@ -39,5 +39,10 @@ "page": "options.html", "open_in_tab": false, "browser_style": true + }, + "commands": { + "popupWindow": { + "description": "__MSG_execute__" + } } } From 6ac719751e76979f480864ef6582f114c827acb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denilson=20S=C3=A1=20Maia?= Date: Thu, 9 Jul 2020 14:47:48 +0200 Subject: [PATCH 08/14] Removing "tabs" permission According to the documentation, `tabs` permission is only needed when reading URL, title or favicon from a tab. None of this is required for this extension, so this permission can be safely removed. After this change, the browser will tell the user this extension doesn't need any special permission. If this extension ever needs such kind of privilege, it should instead declare `activeTab` permission, that grants extra access only to the current tab and only when the extension is used. * https://developer.chrome.com/extensions/windows * https://developer.chrome.com/extensions/tabs * https://developer.chrome.com/extensions/activeTab * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions#activeTab_permission Bonus: for convenience, I've also bumped the version number to 0.1.0. This commit is the firefox version of the pull-request https://github.com/ettoolong/PopupWindow/pull/20 Sidenote: it would be nice to merge both firefox and chrome codebases into a single branch. --- manifest.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 277a68a..4e49d24 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "description": "__MSG_extDescription__", "manifest_version": 2, "name": "__MSG_extName__", - "version": "0.0.8", + "version": "0.1.0", "homepage_url": "https://github.com/ettoolong/PopupWindow", "icons": { "16": "icon/icon.svg", @@ -26,7 +26,6 @@ }, "permissions": [ "storage", - "tabs", "contextMenus" ], "browser_action": { From bd50c11ac7924e0af6c5b82defa0cdf246bdd48e Mon Sep 17 00:00:00 2001 From: Gitoffthelawn Date: Wed, 12 Jan 2022 02:44:16 -0800 Subject: [PATCH 09/14] i18n AMO link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a58794a..e5c916f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # PopupWindow Firefox add-on, move tab to standalone window, without tabs bar, navigation bar and bookmark bar UI. -* Install Firefox add-on: [addons.mozilla.org](https://addons.mozilla.org/zh-TW/firefox/addon/popup-window/) +* Install Firefox add-on: [addons.mozilla.org](https://addons.mozilla.org/firefox/addon/popup-window/) * Install Chrome extension: [Chrome Web Store](https://chrome.google.com/webstore/detail/popup-window/nnlippelgfbglbhiccffmnmlnhmbjjpe) From 41e184e3061a4c4d9de7ee40831e418e6440d130 Mon Sep 17 00:00:00 2001 From: Simon Sobisch Date: Thu, 11 May 2023 22:03:05 +0200 Subject: [PATCH 10/14] add note about contributing translations fixes #1 --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index e5c916f..98dfdd2 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,6 @@ Firefox add-on, move tab to standalone window, without tabs bar, navigation bar * Install Firefox add-on: [addons.mozilla.org](https://addons.mozilla.org/firefox/addon/popup-window/) * Install Chrome extension: [Chrome Web Store](https://chrome.google.com/webstore/detail/popup-window/nnlippelgfbglbhiccffmnmlnhmbjjpe) + +# Contributing +For updating/creating language translations please create a pull request; for new languages please start with [this file](https://github.com/ettoolong/PopupWindow/blob/master/_locales/en/messages.json) and translate it, storing it with the appropriate language tag (for a list of tags, see [here](https://developer.chrome.com/docs/webstore/i18n/?localeTable#choosing-locales-to-support)). From 5bb382ecc95e52bfe885e311a4ba22934935724c Mon Sep 17 00:00:00 2001 From: Simon Sobisch Date: Mon, 15 May 2023 10:04:33 +0200 Subject: [PATCH 11/14] WAM notice fixes #7 --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 98dfdd2..d49be0b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,13 @@ # PopupWindow -Firefox add-on, move tab to standalone window, without tabs bar, navigation bar and bookmark bar UI. +WebExtensions API add-on for moving a tab to standalone window, without tabs bar, navigation bar and bookmark bar UI. -* Install Firefox add-on: [addons.mozilla.org](https://addons.mozilla.org/firefox/addon/popup-window/) -* Install Chrome extension: [Chrome Web Store](https://chrome.google.com/webstore/detail/popup-window/nnlippelgfbglbhiccffmnmlnhmbjjpe) +* Install Firefox add-on: [PopupWindow on addons.mozilla.org](https://addons.mozilla.org/firefox/addon/popup-window/) +* Install Chrome extension: [PopupWindow in Chrome Web Store](https://chrome.google.com/webstore/detail/popup-window/nnlippelgfbglbhiccffmnmlnhmbjjpe) + +# WebAppMode (WAM) +If you want to auto-enable the PopupWindow for specific web pages on FireFox, you can _additional_ install the co-add-on [https://github.com/ettoolong/WebAppMode](WebAppMode). + +* Install Firefox add-on: [WepAppMode on addons.mozilla.org](https://addons.mozilla.org/de/firefox/addon/web-app-mode/) # Contributing For updating/creating language translations please create a pull request; for new languages please start with [this file](https://github.com/ettoolong/PopupWindow/blob/master/_locales/en/messages.json) and translate it, storing it with the appropriate language tag (for a list of tags, see [here](https://developer.chrome.com/docs/webstore/i18n/?localeTable#choosing-locales-to-support)). From c80e506bb5050b3e25634d1e97a4c32dbb9cbd06 Mon Sep 17 00:00:00 2001 From: ettoolong Date: Sat, 20 May 2023 18:03:36 +0800 Subject: [PATCH 12/14] support specifying window size from external message --- background.js | 8 ++++---- manifest.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/background.js b/background.js index f637b1d..619a8eb 100644 --- a/background.js +++ b/background.js @@ -172,10 +172,10 @@ const setBrowserActionIcon = () => { } }; -const popupWindow = (tab, targetUrl, winTop, winLeft) => { +const popupWindow = (tab, targetUrl, winTop, winLeft, winWidth, winHeight) => { let screen = window.screen; - let width = preferences.windowWidth; - let height = preferences.windowHeight; + let width = winWidth ?? preferences.windowWidth; + let height = winHeight ?? preferences.windowHeight; let top = screen.availTop !== undefined ? screen.availTop: screen.top; let left = screen.availLeft !== undefined ? screen.availLeft: screen.left; @@ -346,7 +346,7 @@ const messageHandler = (message, sender, sendResponse) => { if(message.action === 'popupWindow') { chrome.tabs.get(message.tabId, tab => { if(message.left && message.top) { - popupWindow(tab, null, message.left, message.top); + popupWindow(tab, null, message.left, message.top, message.width, message.height); } else { popupWindow(tab); } diff --git a/manifest.json b/manifest.json index 4e49d24..ec235f1 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "description": "__MSG_extDescription__", "manifest_version": 2, "name": "__MSG_extName__", - "version": "0.1.0", + "version": "0.1.1", "homepage_url": "https://github.com/ettoolong/PopupWindow", "icons": { "16": "icon/icon.svg", From 66512052cb69f4568b41c8e8c4751b312d4e47fb Mon Sep 17 00:00:00 2001 From: ettoolong Date: Sat, 20 May 2023 18:38:45 +0800 Subject: [PATCH 13/14] fix bug when specifying window position --- background.js | 4 ++-- manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/background.js b/background.js index 619a8eb..2075f13 100644 --- a/background.js +++ b/background.js @@ -203,10 +203,10 @@ const popupWindow = (tab, targetUrl, winTop, winLeft, winWidth, winHeight) => { left = sLeft; } } - if(winTop) { + if(winTop !== undefined) { top = winTop; } - if(winLeft) { + if(winLeft !== undefined) { left = winLeft; } diff --git a/manifest.json b/manifest.json index ec235f1..8ec0b2b 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "description": "__MSG_extDescription__", "manifest_version": 2, "name": "__MSG_extName__", - "version": "0.1.1", + "version": "0.1.2", "homepage_url": "https://github.com/ettoolong/PopupWindow", "icons": { "16": "icon/icon.svg", From 52cc7006d7ef2a7c84deb2ebb7c21c785a0b6d05 Mon Sep 17 00:00:00 2001 From: ettoolong Date: Sat, 20 May 2023 20:13:30 +0800 Subject: [PATCH 14/14] fix bug when specifying window position --- background.js | 2 +- manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/background.js b/background.js index 2075f13..e6fbc4b 100644 --- a/background.js +++ b/background.js @@ -172,7 +172,7 @@ const setBrowserActionIcon = () => { } }; -const popupWindow = (tab, targetUrl, winTop, winLeft, winWidth, winHeight) => { +const popupWindow = (tab, targetUrl, winLeft, winTop, winWidth, winHeight) => { let screen = window.screen; let width = winWidth ?? preferences.windowWidth; let height = winHeight ?? preferences.windowHeight; diff --git a/manifest.json b/manifest.json index 8ec0b2b..a009928 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "description": "__MSG_extDescription__", "manifest_version": 2, "name": "__MSG_extName__", - "version": "0.1.2", + "version": "0.1.3", "homepage_url": "https://github.com/ettoolong/PopupWindow", "icons": { "16": "icon/icon.svg",