I haven't got a clue about XUL, but after searching I found the following command and managed to get it working working, but it only opens in the current tab.
Code: Select all
if(window.loadURI) loadURI(getShortcutOrURI ('hist',{}));
I then found the following command which opened a new tab and focussed to it, but I can only get that to work if I use a full URL. If I use a bookmark keyword it doesn't work.
Code: Select all
gBrowser.selectedTab = gBrowser.addTab
My reason for wanting to use a bookmark keyword is that I am trying to crate a hotkey that opens my Firefox history in a new tab (rather than in the sidebar or a separate pop up window). The trouble is that whenever I open the following page chrome://browser/content/history/history-panel.xul it shows the url as the tab's title, and I would prefer it to just say "History".
I did try to find out how to specify a tab's display name, but because I don't really understand XUL syntax I'm having difficulty combining the renname commands with the command that opens the tab in the first place. None of the instructions I found gave full examples that included test names (it seems that you're just expected you to know how and where to specify the tab name once you've been given you the actual command). The closest I got was invoking the tab rename function of TabMixPlus (which I use anyway) but all that did was pop up a dialog asking you what you wanted to rename the tab to, rather than just immediately displaying your chosen name for the tab.
After getting nowhere with changing the tab display name by using code, I instead tried using the (now discontinued) TabRenamizer extension to take care of the renaming part. However, TabRenamizer won't show the name saved for the "History" tab when it's opened by Keyconfig using the url: chrome://browser/content/history/history-panel.xul even though the name has been saved as a rule in TabRenamizer. However, if the history tab is opened by pasting the url into the address / location bar (or if it's been opened by bookmark keyword) then the TabRenamizer rule does work and the tab gets renamed to "History".
This problem does not happen when doing the equivalent for Bookmarks (which I rename from "Library" to "Bookmarks"). TabRenamizer always successfully renames the "Library" tab to "Bookmarks" regardless of how the it has been opened.
It therefore seems that the best method would be to just get keyconfig to do the whole thing (i.e. open the history page in a new tab that is focussed and which has been renamed to "History").
Any help on the code to use to do this would be greatly appreciated.