Can I disable opening bookmarks in tabs

Discussion of features in Mozilla Firefox
Post Reply
old Neil Parks
Moderator
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Can I disable opening bookmarks in tabs

Post by old Neil Parks »

I have a bookmark dropdown menu open, and I happen to press the letter "O".

One of three things will happen:

If the folder has more than one bookmark whose name begins with letter "O", one of them will be highlighted. That's okay.

If the folder has only one bookmark starting with "O", it will open. That might not be what I want, but it's not so bad.

But if that folder doesn't have any bookmarks starting with letter "o"--LOOK OUT! The dreaded Open in Tabs will kick in without warning, and if the folder happens to have a lot of bookmarks... OUCH!

Is there any way to disable this behavior?

You may ask, Why would I press "o" if I don't have any bookmarks in that folder that start with "o"? Two possibilities: I forgot that there weren't any, or I was aiming for "I" or "P" but hit "O" by mistake.

I would like to see "O" take no action in this case, or, at worst, just highlight the "open in tabs" but not activate it.

(FWIW, using 1/31 in Win ME.)
AtomB
Posts: 312
Joined: November 8th, 2002, 12:22 am

Post by AtomB »

heck i would just like to see the open in tabs removed from the bookmark folders. i've done similar to your pressing the letter O, sometimes tring to select the last bookmark in the folder and opps clicked to far down and bam, 20 tabs open up. not a fun thing.
User avatar
alanjstr
Moderator
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here
Contact:

Post by alanjstr »

I'm sure someone could write an extension that would remove the context menu items. I'm not sure about the access keys, though.

You could put something in userChrome.css to remove the context menu item.
Former UMO Admin, Former MozillaZine General Mod
I am rarely on mozillaZine, so please do not send me a private message.
My Old Firefox config files
cdn
Posts: 999
Joined: November 4th, 2002, 5:47 pm
Location: UK
Contact:

Post by cdn »

alanjstr wrote:I'm sure someone could write an extension that would remove the context menu items. I'm not sure about the access keys, though.

You could put something in userChrome.css to remove the context menu item.


could probably map the accesskey to something else like '¬'

which would require an override to the entry in browser.dtd

or as you say userChrome.css it, although I cannot find (via DOM Inspector) a reference to 'Open in Tabs' : (
User avatar
alanjstr
Moderator
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here
Contact:

Post by alanjstr »

cdn wrote:although I cannot find (via DOM Inspector) a reference to 'Open in Tabs' : (

Guess you'll have to grep.
Former UMO Admin, Former MozillaZine General Mod
I am rarely on mozillaZine, so please do not send me a private message.
My Old Firefox config files
cdn
Posts: 999
Joined: November 4th, 2002, 5:47 pm
Location: UK
Contact:

Post by cdn »

I don't think it's as simple as that, since the bookmark menu is

constructed by xul template from

the rdf interpretation of

the html

relevant 'code' is in browser.xul, wherever it happens to be in there

edit:

from grepping 'Open in Tabs'

src/mozilla/browser/components/bookmarks/locale/bookmarks.properties:cmd_bm_openfolder = Open in Tabs
src/mozilla/browser/components/bookmarks/locale/bookmarks.properties:cmd_bm_openfolder_accesskey = O

so that is en-US.jar locale/browser/bookmarks/bookmarks.properties

which then leads to grep for 'cmd_bm_openfolder'

src/mozilla/browser/components/bookmarks/content/bookmarks.js: case "cmd_bm_openfolder":

src/mozilla/browser/components/bookmarks/content/bookmarksToolbar.xml: element.setAttribute("label", BookmarksUtils.getLocaleString("cmd_bm_openfolder"));

src/mozilla/browser/components/bookmarks/content/bookmarksToolbar.xml: element.setAttribute("accesskey", BookmarksUtils.getLocaleString("cmd_bm_openfolder_accesskey"));

--

so it looks like an adjustment of browser.jar : content/browser/bookmarks/bookmarksToolbar.xml is required ?
User avatar
alanjstr
Moderator
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here
Contact:

Post by alanjstr »

So you can probably key off of that label.
Former UMO Admin, Former MozillaZine General Mod
I am rarely on mozillaZine, so please do not send me a private message.
My Old Firefox config files
cdn
Posts: 999
Joined: November 4th, 2002, 5:47 pm
Location: UK
Contact:

Post by cdn »

although from looking in the xml

I found a different reference

browser.jar : browser/content/browser.xul: onpopupshowing="document.getElementById('bookmarks-toolbar').showOpenInTabsMenuItem(event.originalTarget)"

so it's probably the onpopupshowing that needs overriding
cdn
Posts: 999
Joined: November 4th, 2002, 5:47 pm
Location: UK
Contact:

Post by cdn »

specifically

Code: Select all

            <menu id="bookmarks-menu" label="&bookmarksMenu.label;" accesskey="&bookmarksMenu.accesskey;"
                  datasources="rdf:bookmarks rdf:files rdf:localsearch rdf:internetsearch"
                  ref="NC:BookmarksRoot" flags="dont-test-empty"
                  onpopupshowing="document.getElementById('bookmarks-toolbar').showOpenInTabsMenuItem(event.originalTarget)"
cdn
Posts: 999
Joined: November 4th, 2002, 5:47 pm
Location: UK
Contact:

Post by cdn »

userChrome.css :

Code: Select all


#openintabs-menuitem {
  display: none !important;
}



currently leaves the separator at the foot of the menu
User avatar
alanjstr
Moderator
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here
Contact:

Post by alanjstr »

<i>something</i>[label="Open in New Tab"] ?
Former UMO Admin, Former MozillaZine General Mod
I am rarely on mozillaZine, so please do not send me a private message.
My Old Firefox config files
cdn
Posts: 999
Joined: November 4th, 2002, 5:47 pm
Location: UK
Contact:

Post by cdn »

alanjstr wrote:<i>something</i>[label="Open in New Tab"] ?


what something - are you thinking of something for userChrome.css ?
old Neil Parks
Moderator
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old Neil Parks »

cdn wrote:

Code: Select all

       onpopupshowing="document.getElementById('bookmarks-toolbar').showOpenInTabsMenuItem(event.originalTarget)"


I saw the above line in several places in browser.xul, and in each case it was followed by a line mentioning
"hideOpenInTabsMenuItem".

So I did a global search and replace to change all occurrences of "showOpenInTabsMenuItem" to "hideOpenInTabsMenuItem".

Seems to work perfectly. Thanks!

But such editiing should not be necessary, IMNSHO. The default behavior should be as I said originally:

I would like to see "O" take no action in this case, or, at worst, just highlight the "open in tabs" but not activate it.
User avatar
AGSHender
Posts: 611
Joined: November 14th, 2002, 11:39 pm
Location: Portland, OR
Contact:

Post by AGSHender »

You could just use a mouse like the rest of us for navigation.... :D

But seriously, though, I like the feature, but I agree with others, it should boobytrapped somehow so that simple things like that can't open it. Is it possible to map something like Alt-O with the menu open? I've never seen a double-key stroke in a menu, so I don't even know if it's possible, although I'm sure if it were easy it would have been done in other apps before now.
Post Reply