I'm having a simple preference pane for Firefox Extension as follows:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<prefwindow title="Preferences"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<preferences>
<preference id="extensions.autofc.signalSuccess" name="extensions.autofc.signalSuccess" type="bool"/>
<preference id="extensions.autofc.dpair" name="extensions.autofc.dpair" type="string"/>
</preferences>
<prefpane label="Preferences">
<checkbox preference="extensions.autofc.signalSuccess" label="Tell me if everything is okay"/>
<label value="NOTE: Errors are always alerted"/>
<html:hr />
<hbox align="center">
<label value="Pair Options" />
<groupbox>
<radiogroup preference="extensions.autofc.dpair">
<radio label="Pair 1" value="ee"/>
<radio label="Pair 2" value="ev"/>
</radiogroup>
</groupbox>
</hbox>
</prefpane>
</prefwindow>
This works perfectly on Linux, meaning users can tick or untick the checkbox or select radio buttons, click Okay and when the Preference is opened again, the latest selections are saved.
What amazed me was that when this was tested on Windows, the selections are not saved, i.e., when opening Preference Pane again, the selections return to the default values.
One thing I've supposed was that the selections in this preference Pane are handled by Firefox but I may be wrong.
Do you guys have any insights on why this doesn't work on Windows. In particular, it didn't work on FF 3.6.1, FF 8, FF 7.0.1 on Windows 7.
You should place <preferences> inside <prefpane>, not <prefwindow>.
Related
How to show the application name in the tiles.
As shown in the figure, i am developing the last application in the screen. For that i need to show the name of the application.
In PackageManifest file i have added all the images to show the images in the home screen.
Any help on this highly appreciated.
Thank you.
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="MMRevamp_2016.App">
<uap:VisualElements DisplayName="Maalaimalar" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="MMRevamp_2016" BackgroundColor="transparent">
<uap:LockScreen Notification="badge" BadgeLogo="Images\BadgeLogo.png" />
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square71x71Logo="Images\Square142x142Logo.png" Square310x310Logo="Images\Square310x310Logo.png">
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="square310x310Logo" />
</uap:ShowNameOnTiles>
</uap:DefaultTile>
</uap:VisualElements>
</Applications>
If you open your Package.appxmanifest and go to Visual Assets, you will see show name with check boxes. Check off appropriate box next to your asset.
See Screenshot for Example
If you are doing XML you can set the branding attribute to "name" as well. E.g like this:
<tile>
<visual>
<binding template="TileMedium" branding="name">
</binding>
</visual>
</tile>
I want to create extension that replaces the blank page with my content
(static links plus data via ajax/iframe requests)
How should I start, where I can found usefull documentation? How can I
separate tab state when tab is blank or when tab is showing some website.
Is such code enough for minimal example
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="speeddialOverlay">
<window id="main-window">
<vbox id="speeddial-multikey-wrapper">
<iframe src="http://www.somesite.com"></iframe>
</vbox>
</window>
</overlay>
I have created a XUL dialog, whenever i open this dialog it opens with Firefox navigation bar. Is it possible to open the XUL applications without firefox navigation bar? Screenshot is attached. Iam using Javascript's window.open command. i.e
window.open("http://localhost/test.xul", "test", "chrome, width=130,height=60, menubar=no");
Here is the XUL code
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<dialog id="donothing" title="Dialog example"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
buttons="accept,cancel"
buttonlabelcancel="Cancel"
buttonlabelaccept="Save"
ondialogaccept="return doOK();"
ondialogcancel="return doCancel();">
<dialogheader title="Options" description="My preferences"/>
<groupbox>
<caption label="Colour"/>
<radiogroup>
<radio label="Red"/>
<radio label="Green" selected="true"/>
<radio label="Blue"/>
</radiogroup>
<label value="Nickname"/>
<textbox/>
</groupbox>
</dialog>
Try adding "location=no" to the window.open:
window.open("http://localhost/test.xul", "test", "chrome, width=130,height=60, menubar=no, location=no");
See window.open for reference.
i'm trying to make an own firefox toolbar and I have problem with overlay.
So i already setup my environment (i can see my extension in FF extensions manager), now I'm trying to add new overlay.
chrome.manifest
content sandbox chrome/content/
overlay chrome://browser/content/browser.xul chrome://sandbox/content/overlay.xul
overlay.xul
<?xml version="1.0"?>
<overlay
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<toolbox id="browser-toolbox">
<toolbar id="findfile_toolbar">
<label control="findfile_filename" value="Search for files named:"/>
<textbox id="findfile_filename"/>
<label control="findfile_dir" value="Directory:"/>
<textbox id="findfile_dir"/>
<button label="Browse..."/>
</toolbar>
</toolbox>
</overlay>
When i restart my FF i don't see result, where is the problem?
I think the problem might be that your toolbox element ID is "browser-toolbox" not navigator-toolbox. In Firefox, if you want to add a toolbar to the UI, you need to use "navigator-toolbox" as the toolbox ID.
You can read more about toolbar development at the Born Geek toolbar tutorial.
I am trying to update a custom firefox extension that I created for some tasks at work. Basically it is a sidebar that pulls up one of our webpages in an iframe for various purposes. When moving to Firefox 3 the iframe won't appear at all.
Below is an example of the XUL files that contains extension specific code including iframe, currently with just an attempt to load google but it it won't work with anything. I can't find any mention online of changes in FF3 that would cause this. Any suggestions would be appreciated.
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://customsidebar/skin/customsidebar.css" type="text/css"?>
<overlay id="customsidebar-Main" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://customsidebar/content/customsidebar.js"/>
<vbox flex="1">
<toolbar>
<vbox>
<hbox id="customsidebar_TopToolbarRow">
<toolbarbutton label="Refresh" id="customsidebar_Refresh" oncommand="customsidebar_Refresh()" />
</hbox>
<hbox>
<label control="customsidebar_StatusBox" value="Log"/>
<textbox id="customsidebar_StatusBox" multiline="true" rows="1" wrap="off" />
</hbox>
</vbox>
</toolbar>
<iframe id="customsidebar_Iframe" src="http://www.google.com" />
</vbox>
</overlay>
Here is the overlay XUL file
<?xml version="1.0"?>
<overlay id="CustomSidebar-Overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<menupopup id="viewSidebarMenu">
<menuitem observes="viewCustomSidebar" />
</menupopup>
<broadcasterset id="mainBroadcasterSet">
<broadcaster id="viewCustomSidebar"
autoCheck="false"
label="CustomSidebar"
type="checkbox" group="sidebar"
sidebarurl="chrome://customersidebar/content/customersidebarMain.xul"
sidebartitle="CustomSidebar"
oncommand="toggleSidebar('viewCustomSidebar');"/>
</broadcasterset>
</overlay>
Set flex="1" on the iframe
The XUL code for sidebar is not an overlay, it's a document loaded inside an iframe (look at the Firefox main window in the DOM inspector). So the root element should be <page>, not <overlay>. This, combined with the flex="1", should make the page display.
You usually want to put type="content" or type="content-primary" on the iframe. Definitely so if you load untrusted pages in it.
I would try setting flex="1" on the iframe. If that's not working, perhaps try it with the browser element instead of iframe.