I developed a simple new sidebar, which does nothing more than show a
certain URL.
The main reason is to access a page with intranet links in the sidebar
and open this through a keyboard shortcut.
But if I control-click on links in that sidebar for opening new tabs,
the content is displayed in the current tab. And a right click doesn't
show any context menu.
If I open the Page through a bookmark with the setting "open in
sidebar" all works fine, but I cannot access this link through a
keyboard-shortcut.
Here is my main extension code:
<overlay id="indiwaSidebar"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<menupopup id="viewSidebarMenu">
<menuitem key="key_openindiwaSidebar" observes="viewindiwaSidebar"
/>
</menupopup>
<keyset id="mainKeyset">
<key id="key_openindiwaSidebar" command="viewindiwaSidebar"
keycode="VK_F4" modifiers="" />
</keyset>
<broadcasterset id="mainBroadcasterSet">
<broadcaster id="viewindiwaSidebar"
label="indiwa Sidebar"
autoCheck="false"
type="checkbox"
group="sidebar"
sidebarurl="http://my.intranet.url"
sidebartitle="indiwa Sidebar"
oncommand="toggleSidebar('viewindiwaSidebar');" />
</broadcasterset>
</overlay>
How can I make this Sidebar work like a normal Page, with Ctrl-Click
for new Tabs and Right-Click for Context Menu?
<iframe id="gj53run-sidebar-iframe" flex="1"
src="chrome://gj53run/content/CookBook/MySidebar.htm"/>
example xul file
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://gj53run/skin/gj53run.css"
type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://gj53run/locale/gj53run.dtd">
<window
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
id="gj53run-ShowMenu-sidebar"
onload="gj53runSidebarMenuOnload()"
onunload="gj53runSidebarMenuOnUnload()">
<script type="application/x-javascript"
src="chrome://gj53run/content/utilsxul.js"/>
<script type="application/x-javascript"
src="chrome://gj53run/content/gj53runMenuXUL.js"/>
<iframe id="gj53run-sidebar-iframe" flex="1"
src="chrome://gj53run/content/CookBook/MySidebar.htm"/>
</window>
Then something like this in your overlay will work
<broadcaster id="gj53run-xxh-sidebar"
autoCheck="false"
label="&gj53run.menuitem.SFT2.label;"
type="checkbox" group="sidebar"
sidebarurl="chrome://gj53run/content/xxxx.xul"
oncommand="toggleSidebar('gj53run-xxxxx-sidebar');"/>
If you follow the links from www.cookdotcom.com you can download my
alpha extension.
There is a working example their, it the main menu