xul

Get current page URL from a firefox sidebar extension

北城以北 提交于 2019-11-28 16:34:11
I'm writing a sidebar extension for Firefox and need a way to get the URL of the current page so I can check it against a database and display the results. How can I do this? window.top.getBrowser().selectedBrowser.contentWindow.location.href; might work, otherwise I think you need to use: var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIWebNavigation) .QueryInterface(Components.interfaces.nsIDocShellTreeItem) .rootTreeItem .QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces

What's the best way to communicate with a Firefox addon

一曲冷凌霜 提交于 2019-11-28 14:24:22
I need to be able to get the URL from the active tab in Firefox. DDE doesn't work with multiple instances so I was thinking that I could build an addon that sets a global atom or something. I also thought that maybe I could use the clipboard, but I don't want to overwrite any existing text and custom clipboard types doesn't seem to be supported. I don't want to resort to writing a file just to do simple IPC...so before I do it...is there a better choice for something so simple. thanks The usual way of communicating from an application to a Firefox add-on is via TCP sockets. You create an

How to insert xul panel so doesn't minimize with window

旧巷老猫 提交于 2019-11-28 12:46:08
问题 I create a panel and insert it into the id mainPopupSet area of the most recent navigator:browser window. I set the level to top so it shows over everything. But if that window closes the panel goes, also if that window minimizes it screws with the panel. Is there anywhere I can insert it so it doesn't minmize? And will only disappear when Firefox exists? 来源: https://stackoverflow.com/questions/21926453/how-to-insert-xul-panel-so-doesnt-minimize-with-window

Is history.replaceState broken for XUL applications and plugins?

我们两清 提交于 2019-11-28 10:38:05
问题 I have a browser object in my XUL application like so: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin" type="text/css"?> <window title="Students" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" width="800px" height="500px"> <groupbox flex="1"> <caption label="Students"/> <browser type="chrome" src="chrome://myapp/content/index.html" flex="1"/> </groupbox> </window> And the index.html is: <!DOCTYPE html> <html>

Using Add-on SDK to add toolbar buttons? Integrating XUL and Add-on SDK for Firefox Add-ons?

与世无争的帅哥 提交于 2019-11-28 09:16:15
I have already coded most of a Firefox add-on using the Add-on SDK API. I am now discovering that Add-on SDK might not be powerful enough for my purposes. I need two things: A drop down button in the toolbar next to the location bar. To modify the add-ons manager in firefox It is truly disappointing, but I don't believe either of these is possible with the Add-on SDK. First of all, I understand there is a widget module in the Add-on SDK API. But this only allows me to add a simple icon or label to the awkward add-on bar. What if I need to add a nicer button like the one next to the location

Expose file writing to a webpage with a Firefox extension

家住魔仙堡 提交于 2019-11-28 05:26:17
问题 I have a web application that my client uses for the cash registry. What I need to do is to create a local file as the cash register's software needs to read from that file in order to print. Until now i was using this code: netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); file.initWithPath(filePath); Unfortunately with the latest version of firefox this isn

Firefox WebExtension settings page

狂风中的少年 提交于 2019-11-28 00:18:17
I have a settings page on my WebExtension, but I dont know how to acces the values of the settings with javascript. Current .xul-File: <?xml version="1.0"?> <!DOCTYPE mydialog SYSTEM "chrome://myaddon/locale/mydialog.dtd"> <vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <setting type="string" pref="extensions.check.email" title="email" desc="please insert your email here" /> </vbox> How do I acces the "email" value? Can I just write something like "getPreferences('email')"? Makyen Don't use XUL in a WebExtension add-on : If you are using XUL from within a

Finding the currently logged in user from a Firefox extension

白昼怎懂夜的黑 提交于 2019-11-27 16:43:46
问题 I'm writing a Firefox extension that needs to know what the username of the currently logged in user is in Windows, Mac, or Linux. So if I'm logged into my machine as "brh", it'll return "brh". Any idea how to do that from extension JavaScript? 回答1: Firefox extensions play by different rules to normal JavaScript running in the page: finding the current user is absolutely possible. Open your Error Console (in Tools) and enter this: Components.classes["@mozilla.org/process/environment;1"]

.setAttribute(“disabled”, false); changes editable attribute to false

99封情书 提交于 2019-11-27 04:35:00
I want to have textboxes related to radiobuttons. Therefore each radio button should enable it's textbox and disable the others. However when I set the disabled attribute of textbox to true, it changes the editable attribute too. I tried setting editable attribute true again but it did not work. This was what I tried: JS function: function enable(id) { var eleman = document.getElementById(id); eleman.setAttribute("disabled", false); eleman.setAttribute("editable", true); } XUL elements: <radio id="pno" label="123" onclick="enable('ad')" /> <textbox id="ad" editable="true" disabled="true" flex=

Using Add-on SDK to add toolbar buttons? Integrating XUL and Add-on SDK for Firefox Add-ons?

我怕爱的太早我们不能终老 提交于 2019-11-27 02:54:24
问题 I have already coded most of a Firefox add-on using the Add-on SDK API. I am now discovering that Add-on SDK might not be powerful enough for my purposes. I need two things: A drop down button in the toolbar next to the location bar. To modify the add-ons manager in firefox It is truly disappointing, but I don't believe either of these is possible with the Add-on SDK. First of all, I understand there is a widget module in the Add-on SDK API. But this only allows me to add a simple icon or