11// ==UserScript==
22// @name Open Bookmark in Container Tab (context menu)
3- // @version 1.2.1
3+ // @version 1.2.2
44// @author aminomancer
55// @homepage https://github.com/aminomancer/uc.css.js
66// @description Adds a new menu to context menus prompted by right-clicking
@@ -27,8 +27,6 @@ class OpenPlacesInContainerTabMenu {
2727 l10n : {
2828 // Appears when right-clicking a container/folder in bookmarks or history.
2929 openAll : `Open All in Container Tabs` ,
30- // Appears when right-clicking a tab in the synced tabs sidebar.
31- openSyncedTab : `Open in a New Container Tab` ,
3230 // All of the menu items use a predefined access key. Access keys are
3331 // underlined in the menu item's label, and pressing them on your keyboard
3432 // automatically selects the menu item. They serve as hotkeys while the
@@ -39,7 +37,7 @@ class OpenPlacesInContainerTabMenu {
3937 // though. If the chosen access key is not present in the menu item's
4038 // label, instead of being underlined in the label, it will be shown after
4139 // the label in parentheses, e.g. "Open All in Container Tabs (G)"
42- accessKey : `c ` ,
40+ accessKey : `i ` ,
4341 } ,
4442 } ;
4543 constructor ( ) {
@@ -100,20 +98,6 @@ class OpenPlacesInContainerTabMenu {
10098 ) ;
10199 popups . push ( syncedOpenAllPopup ) ;
102100
103- this . syncedMenuOpenInContainer = this . create ( document , "menu" , {
104- id : "syncedTabsOpenInContainer" ,
105- label : l10n . openSyncedTab ,
106- accesskey : l10n . accessKey ,
107- disabled : true ,
108- hidden : true ,
109- } ) ;
110- this . syncedMenuOpenTab . after ( this . syncedMenuOpenInContainer ) ;
111- let syncedOpenPopup = this . syncedMenuOpenInContainer . appendChild (
112- document . createXULElement ( "menupopup" )
113- ) ;
114- syncedOpenPopup . addEventListener ( "command" , e => this . openSyncedTab ( e , syncedOpenPopup ) ) ;
115- popups . push ( syncedOpenPopup ) ;
116-
117101 this . syncedContextMenu . addEventListener ( "popupshowing" , this ) ;
118102 this . syncedFilterContextMenu . addEventListener ( "popupshowing" , this , { once : true } ) ;
119103 }
@@ -200,14 +184,6 @@ class OpenPlacesInContainerTabMenu {
200184 ( this . _syncedMenuOpenAll = this . syncedContextMenu . querySelector ( "#syncedTabsOpenAllInTabs" ) )
201185 ) ;
202186 }
203- get syncedMenuOpenTab ( ) {
204- return (
205- this . _syncedMenuOpenTab ||
206- ( this . _syncedMenuOpenTab = this . syncedContextMenu . querySelector (
207- "#syncedTabsOpenSelectedInTab"
208- ) )
209- ) ;
210- }
211187 get syncedMenuCopy ( ) {
212188 return (
213189 this . _syncedMenuCopy ||
@@ -257,8 +233,6 @@ class OpenPlacesInContainerTabMenu {
257233 this . syncedContextMenuInited = true ;
258234 this . syncedMenuOpenAllInContainer . disabled = this . syncedMenuOpenAll ?. disabled ;
259235 this . syncedMenuOpenAllInContainer . hidden = this . syncedMenuOpenAll ?. hidden ;
260- this . syncedMenuOpenInContainer . disabled = this . syncedMenuOpenTab ?. disabled ;
261- this . syncedMenuOpenInContainer . hidden = this . syncedMenuOpenTab ?. hidden ;
262236 }
263237 openLinkInContainer ( e , popup , item ) {
264238 let win = window . gBrowser ? window : BrowserWindowTracker . getTopWindow ( ) ;
@@ -309,11 +283,6 @@ class OpenPlacesInContainerTabMenu {
309283 } else items = folder ;
310284 this . openLinkInContainer ( e , popup , items ) ;
311285 }
312- openSyncedTab ( e , popup ) {
313- if ( ! this . syncedContextMenuInited ) return ;
314- if ( popup . triggerNode ?. closest ( ".tabs-container" ) )
315- this . openLinkInContainer ( e , popup , this . selectedSyncedTab ) ;
316- }
317286 openAllSyncedFromDevice ( e , popup ) {
318287 if ( ! this . syncedContextMenuInited ) return ;
319288 if ( popup . triggerNode ?. closest ( ".tabs-container" ) )
@@ -327,6 +296,7 @@ class OpenPlacesInContainerTabMenu {
327296 sss . loadAndRegisterSheet ( uri , sss . AUTHOR_SHEET ) ;
328297 }
329298}
299+
330300if (
331301 location . href !== `chrome://browser/content/browser.xhtml` ||
332302 gBrowserInit . delayedStartupFinished
0 commit comments