You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// @description Adds a new menu to context menus prompted by right-clicking bookmarks, history entries, etc. that allows you to open them in a container tab. This does basically the same thing as the similarly-named addon by Rob Wu, just by a different method. By doing this with an autoconfig script, we can make the menu appear in a logical order towards the top of the context menu rather than at the very bottom, where context menu items from addons always go.
6
+
// @description Adds a new menu to context menus prompted by right-clicking bookmarks, history entries, etc. that allows you to open them in a container tab. This does basically the same thing as the similarly-named addon by Rob Wu, just by a different method. By doing this with an autoconfig script, we can make the menu appear in a logical order towards the top of the context menu rather than at the very bottom, where context menu items from addons always go. Since Bug 1754805, the main menu created by this script is obsolete — the "Open in New Container Tab" menu opened on bookmarks and history items. So as of version 1.2, that menu has been removed. However, this still
7
7
// @license This Source Code Form is subject to the terms of the Creative Commons Attribution-NonCommercial-ShareAlike International License, v. 4.0. If a copy of the CC BY-NC-SA 4.0 was not distributed with this file, You can obtain one at http://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
@@ -15,7 +15,6 @@ class OpenPlacesInContainerTabMenu {
15
15
staticconfig={
16
16
l10n: {
17
17
openAll: `Open All in Container Tabs`,// Appears when right-clicking a container/folder in bookmarks or history.
18
-
openBookmark: `Open in New Container Tab`,// Appears when right-clicking a bookmark, history item, etc.
19
18
openSyncedTab: `Open in a New Container Tab`,// Appears when right-clicking a tab in the synced tabs sidebar.
20
19
accessKey: `c`,// All of the menu items use a predefined access key. Access keys are underlined in the menu item's label, and pressing them on your keyboard automatically selects the menu item. They serve as hotkeys while the context menu is open. The default access key is "c" for the english "Container." This collides with the "Copy" menu item, so if you leave this set to "c" the script will change the Copy access key to "y" so they don't collide. It won't do that if you change this variable though. If the chosen access key is not present in the menu item's label, instead of being underlined in the label, it will be shown after the label in parentheses, e.g. "Open All in Container Tabs (G)"
21
20
},
@@ -27,20 +26,6 @@ class OpenPlacesInContainerTabMenu {
Copy file name to clipboardExpand all lines: JS/openLinkInUnloadedTab.uc.js
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
// ==UserScript==
2
2
// @name Open Link in Unloaded Tab (context menu item)
3
-
// @version 1.5
3
+
// @version 1.5.1
4
4
// @author aminomancer
5
5
// @homepage https://github.com/aminomancer
6
6
// @description Add a new menu item to context menus prompted by right/accel-clicking on links or other link-like affordances. The menu item will open the link in a new background tab without loading the page. So the tab will start unloaded or "discarded." The context menu entry appears in the content area context menu when right-clicking a link; and in every menu where bookmarks, history, and synced tabs can be interacted with — sidebar, menubar, toolbar, toolbar button popup, and library window. Script is a remake of "Open in Unloaded Tab" by xiaoxiaoflood, but intended for use with fx-autoconfig by MrOtherGuy. It should still work with other loaders that load user scripts per-window, such as alice0775's loader, but is not compatible with older loaders or those like xiaoxiaoflood's loader. The difference is that those loaders run scripts in the global execution context, and simply call a global function when a window is launched, (the global function takes the window as a parameter) whereas fx-autoconfig loads normal scripts entirely within the window context, unless explicitly told to do otherwise. When you open a bookmark or history item in an unloaded tab, the tab draws its title from the entry in the places database. But when you open a link in an unloaded tab, there is no preexisting title. Normally when opening a link in a tab, the title is updated as the tab loads, but since we're opening the tab unloaded from the beginning, Firefox is less likely to know what the document's final title is. By default, the script works around this by generating a temporary title for the tab based on the text of the link that was opened. So if you click a hyperlink "https://mozilla.org" whose label text says "Mozilla" the title will be set to Mozilla until the tab is loaded. But if you click a hyperlink whose label text is the same as the URL itself, the title will simply be the URL. There's a user preference for this, however. If you just want to use the URL for the title no matter what, toggle this pref to false in about:config: "userChrome.openLinkInUnloadedTab.use_link_text_as_tab_title_when_unknown"
Copy file name to clipboardExpand all lines: README.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -820,11 +820,9 @@ This does basically the same thing as the [similarly-named addon](https://addons
820
820
821
821
The menu will be present in _all_ context menus where you'd be able to open a bookmark, history entry, or synced tab, including menus, popups, panels, and even the Library/Bookmarks Manager window. However, for synced tabs, it will only be present in the sidebar, not in the profile panel, because the profile panel lacks a context menu in the first place. Right-clicking a synced tab in the profile panel simply opens the synced tab rather than opening a context menu.
822
822
823
-
Update: The developers of Firefox Multi-Account Containers have implemented an optional setting that creates a similar menu when right-clicking bookmarks. However, this has all the same problems as the addon previously mentioned. It doesn't work on history entries or synced tabs, it puts the menu item at the bottom of the context menu instead of with the other "open x in tab" menu items, and it doesn't apply the correct colors to the container icons.
823
+
Update: Firefox has implemented a similar menu for bookmarks and history items. It doesn't yet support opening all bookmarks in a folder, and it doesn't add a similar menu to the synced tabs sidebar. So for the moment, this script still has some purpose. It's been updated to avoid making a redundant menu, so if you see 2 identical menus, update your script with the version on this repo.
824
824
825
-
That is, the "Personal" container is set to blue by default. It shows up as blue in all the native interfaces and in the extension pages & popups. But because extensions can't control context menu CSS, it isn't blue in the extension's optional bookmark context menu. All the icons in the extension menu are just black.
826
-
827
-
So for several reasons, this script is still the best solution. If you use this script, turn off the redundant extension menus in `about:addons` > Firefox Multi-Account Containers > Options > "Enable Bookmark Menus"
825
+
If you use this script and Firefox Multi-Account Containers, turn off the redundant extension menus in `about:addons` > Firefox Multi-Account Containers > Options > "Enable Bookmark Menus"
0 commit comments