From ccc7d9f2d996efb7f9e2da7aa3ac08d0cab34994 Mon Sep 17 00:00:00 2001 From: PressJump <40802367+PressJump@users.noreply.github.com> Date: Sat, 7 Jan 2023 19:27:09 +1100 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=94=A7=20Update=20Permissions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 6b6dc88..18a6d29 100644 --- a/manifest.json +++ b/manifest.json @@ -10,7 +10,10 @@ "tabs", "webRequest", "activeTab", - "https://icons.duckduckgo.com/" + "https://icons.duckduckgo.com/", + "menus", + "", + "contextMenus" ], "web_accessible_resources": [ "icon.svg", From 8e5bd5a961df4cb9020d47b7d0b2ed2115d636b5 Mon Sep 17 00:00:00 2001 From: PressJump <40802367+PressJump@users.noreply.github.com> Date: Sat, 7 Jan 2023 19:27:51 +1100 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9C=A8=20Context=20Menu=20Option=20for?= =?UTF-8?q?=20Adding=20to=20Sidebar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/background.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/js/background.js b/js/background.js index 642f18e..e5bb9fa 100644 --- a/js/background.js +++ b/js/background.js @@ -122,3 +122,24 @@ browser.runtime.onMessage.addListener(({ type, data }, sender) => { return null }) + +// ============================================================================= +// Context Menu Logic + +const sidebartabs = browser.menus.create({ + title: 'Add to Sidebar', + contexts: ['page'], + documentUrlPatterns: ['*://*/*'], +}) + +browser.menus.onClicked.addListener(function (info, tab) { + switch (info.menuItemId) { + case sidebartabs: + createSidebarItem({ + title: tab.title, + iconUrl: tab.favIconUrl, + webviewUrl: tab.url, + }) + break + } +}) From 8df2c0d336c265c4614ebadbfe480342b02a47f2 Mon Sep 17 00:00:00 2001 From: PressJump <40802367+PressJump@users.noreply.github.com> Date: Sat, 7 Jan 2023 21:46:47 +1100 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=8D=B1=20Update=20Extension=20Icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- icon.svg | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/icon.svg b/icon.svg index 037737c..8fb549b 100644 --- a/icon.svg +++ b/icon.svg @@ -1 +1,13 @@ - \ No newline at end of file + + + + + + +