xul

getElementById a XBL bound XUL element

♀尐吖头ヾ 提交于 2019-12-21 23:56:52
问题 I'm trying to access a XUL element which was XBL bound. I want to controll it from the javascript. This is the binding. <binding id="imip-throbber"> <resources> <stylesheet src="chrome://lightning/skin/lightning-widgets.css"/> </resources> <content pack="center" align="center"> <xul:image anonid="loading-throbber" src="chrome://global/skin/icons/loading_16.png" hidden="false"/> </content> </binding> This is the CSS binding imip-throbber { -moz-binding: url(chrome://lightning/content/lightning

How to create hidden Firefox Extension?

余生颓废 提交于 2019-12-21 23:46:15
问题 Is it possible to create Firewox extension that will not shown in Extensions List? And so cannot be deinstalled manually? 回答1: See this mozillazine entry and this forum entry. These extensions are somehow installed via the registry and supposed to be malicious - so there's no use for this except if you want to be on some malware blacklist. For private use or administration use like MSalters suggested in his comment, "hidden" (for some users) extensions could be useful, but this should be

how to package a standalone xulrunner application

别说谁变了你拦得住时间么 提交于 2019-12-21 12:06:45
问题 I was wondering what I need to do to create an executable (.exe) file that will run my XUL application? I'm trying to create an application using Mozilla's XUL format. 回答1: Here are the steps: Compress your application folder tree using WinZip. Rename the .zip file to have a .xpi extension. (i.e., myApp.xpi). Assuming you have xulrunner in your PATH, execute: xulrunner --install-app myApp.xpi. On Windows, this installs your app to c:\Program Files\<Vendor>\<Application Name>\<Application Name

What is the proper way to get bounding box for HTML elements relative to the Window?

独自空忆成欢 提交于 2019-12-21 12:00:57
问题 I'm writing a Firefox extension. I'm trying to limit it to just XUL+Javascript (no XPCOM). When I get a mouseover event for an HTML element, I need to get its bounding box in the windows coordinate system (that is the built-in XUL document browser.xul). The obvious place to start is to put something like this in the mouseover event handler: var rect = e.target.getBoundingClientRect(); Which is great, but that gives me the rect in the HTML document's coordinate system, which is relative to the

Opening a URL in current tab/window from a Firefox Extension

拟墨画扇 提交于 2019-12-20 10:35:22
问题 I am creating a Firefox Extension...what would be the javascript to open a URL in the current tab from a menuitem? e.g. in my overlay.xul file i have the following line: <menuitem label="Visit homepage" oncommand="window.location='http://www.somepage.com'"/> but in firefox, when i click on the menu item, it opens the URL but it screws up the entire layout of the browser. What's the correct way to do this? 回答1: After browsing around, I found that I had to replace the above code with this:

Can I set the background color in a Firefox extension's popup notification?

大憨熊 提交于 2019-12-20 05:58:24
问题 I am using the popup notification system described in the tutorial https://developer.mozilla.org/en/Using_popup_notifications . It is possible to change the background-color or text-color of the popup? 回答1: The example code in the documentation creates a <popupnotification popupid="sample-popup"> tag in the browser window (obviously, popupid attribute depends on the ID you specified when opening the notification), you can style it. Add the following code to a CSS file loaded by your browser

Calling a method from XBL

↘锁芯ラ 提交于 2019-12-20 05:39:08
问题 From a XBL method, when I need to call another method, I do like: <method name="myMethod_1"> <body> <![CDATA[ // do staff ]]> </body> </method> <method name="myMethod_2"> <body> <![CDATA[ document.getElementById("thisElementID").myMethod_1(); ]]> </body> </method> I would like to know if is there a way to call the local method without need the element id? I've tried this.myMethod_1() but it says the method don't exist. 回答1: can you show us code calling myMethod_2? If you call it like:

Why are CSS declarations for about:addons placed in userContent and not userChrome, given that the namespace is XUL?

筅森魡賤 提交于 2019-12-19 10:45:37
问题 Why do CSS declarations for about:addons have to be placed in userContent and not userChrome , given that the namespace of about:addons is XUL ? This is regarding CSS programming for Firefox. Related: What namespace should be defined in Firefox's userContent.css? 回答1: The short answer to this is that the page about:addons is considered content. Thus, userContent.css is used. The namespace(s) (e.g. HTML, XUL) of the elements used in the <document> don't matter with respect to which of

Dynamic way to unbind dynamically binded XBL

若如初见. 提交于 2019-12-18 09:35:10
问题 I am applying a binding like this in a restartless add-on: var css = '.findbar-container { -moz-binding:url("' + self.path.chrome + 'findbar.xml#matchword") }'; var cssEnc = encodeURIComponent(css); var newURIParam = { aURL: 'data:text/css,' + cssEnc, aOriginCharset: null, aBaseURI: null } cssUri = Services.io.newURI(newURIParam.aURL, newURIParam.aOriginCharset, newURIParam.aBaseURI); myServices.sss.loadAndRegisterSheet(cssUri, myServices.sss.USER_SHEET); findbar.xml contents are: <?xml

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

£可爱£侵袭症+ 提交于 2019-12-17 21:33:55
问题 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 回答1: