From e2da5f1d4d93741c8b43e426faf5822b0f9149a1 Mon Sep 17 00:00:00 2001 From: Asif Youssuff Date: Wed, 19 Dec 2018 14:12:44 -0500 Subject: [PATCH] Conversion to bookmark all tabs (instead of bookmark to right) --- README.md | 6 ++---- _locales/en/messages.json | 8 ++++---- background.js | 14 +++++++------- bookmarkright.svg => bookmark.svg | 5 ++--- bookmarks.html | 2 +- manifest.json | 12 ++++++------ 6 files changed, 22 insertions(+), 25 deletions(-) rename bookmarkright.svg => bookmark.svg (82%) diff --git a/README.md b/README.md index decec87..fb6e582 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ -bookmark tabs to right +Bookmark All Tabs -![context menu](https://mdejean.github.io/bookmarktoright/screenshot.png) - -![popup](https://mdejean.github.io/bookmarktoright/screenshot2.png) +This add-on restores the Bookmark All Tabs feature in thr main context menu of the Firefox tab bar that was moved in version 64. Except as otherwise noted, this software is distributed under the terms of the GNU General Public License, version 2 or later. See LICENSE for the full text. Alternate licensing is available. diff --git a/_locales/en/messages.json b/_locales/en/messages.json index f1bbb24..47c364c 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1,21 +1,21 @@ { "extensionName": { - "message": "Bookmark Tabs to the Right", + "message": "Bookmark All Tabs", "description": "Name of the extension." }, "extensionDescription": { - "message": "Bookmark tabs to the right of a tab by right clicking or the current tab with a key command", + "message": "Bookmark all tabs. Fork of Bookmark Tabs to the Right.", "description": "Description of the extension." }, "menuItem": { - "message": "Bookmark Tabs to the Right", + "message": "Bookmark All Tabs…", "description": "Tab context menu item" }, "commandDescription": { - "message": "Bookmark tabs to the right", + "message": "Bookmark All Tabs…", "description": "Keyboard shortcut description" }, diff --git a/background.js b/background.js index b5564c6..4ab3e2e 100644 --- a/background.js +++ b/background.js @@ -22,11 +22,11 @@ async function showBookmarkWindow(tabs) { }); } -async function bookmarkRight(window, index) { +async function bookmarkAll(window, index) { let tabs = await browser.tabs.query({windowId: window}); //to the right of index - tabs = tabs.filter((t) => t.index > index); + //tabs = tabs.filter((t) => t.index > index); //remove duplicate tabs tabs = tabs.filter((t1, i1) => @@ -39,21 +39,21 @@ async function bookmarkRight(window, index) { browser.contextMenus.create({ contexts: ['tab'], - id: 'bookmark-right', + id: 'bookmark-all', title: browser.i18n.getMessage('menuItem') }); browser.contextMenus.onClicked.addListener((info, tab) => { - if (info.menuItemId == 'bookmark-right') { - bookmarkRight(tab.windowId, tab.index); + if (info.menuItemId == 'bookmark-all') { + bookmarkAll(tab.windowId, tab.index); } }); browser.commands.onCommand.addListener(async (command) => { - if (command == 'bookmark-right') { + if (command == 'bookmark-all') { let tabs = await browser.tabs.query({ active: true, windowId: browser.windows.WINDOW_ID_CURRENT }); - bookmarkRight(browser.windows.WINDOW_ID_CURRENT, tabs[0].index); + bookmarkAll(browser.windows.WINDOW_ID_CURRENT, tabs[0].index); } }); diff --git a/bookmarkright.svg b/bookmark.svg similarity index 82% rename from bookmarkright.svg rename to bookmark.svg index cbf1074..60005d8 100644 --- a/bookmarkright.svg +++ b/bookmark.svg @@ -5,6 +5,5 @@ - - - \ No newline at end of file + + diff --git a/bookmarks.html b/bookmarks.html index 296852f..55ea3be 100644 --- a/bookmarks.html +++ b/bookmarks.html @@ -18,8 +18,8 @@
- +
diff --git a/manifest.json b/manifest.json index 1d38c64..98fa842 100644 --- a/manifest.json +++ b/manifest.json @@ -1,13 +1,13 @@ { "name": "__MSG_extensionName__", "description": "__MSG_extensionDescription__", - "homepage_url": "https://github.com/mdejean/bookmarktoright", + "homepage_url": "https://github.com/yoasif/bookmark-all-tabs", "manifest_version": 2, - "version": "1.3", + "version": "1.0", "icons": { - "16": "bookmarkright.svg", - "48": "bookmarkright.svg", - "96": "bookmarkright.svg" + "16": "bookmark.svg", + "48": "bookmark.svg", + "96": "bookmark.svg" }, "applications": { "gecko": { @@ -17,7 +17,7 @@ "commands": { "bookmark-right": { - "suggested_key": { "default": "Ctrl+Shift+Period" }, + "suggested_key": { "default": "Ctrl+Shift+D" }, "description": "__MSG_commandDescription__" } },