xul

Access the Add-on SDK from within a traditional XUL-based add-on?

孤街醉人 提交于 2019-12-10 10:16:49
问题 I have a large and complex XUL-based addon for which I need to use a few functions from the Add-on SDK. Is this possible? If so, does anyone have working sample code, preferably using the page-worker module? 回答1: The following is the way devtools does it, but certain modules will choke (the obvious candidate being self ). I think you will have better luck with low-level modules. let {Loader} = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {}); let loader = new Loader.Loader({

Accessing cookies, hopefully in JavaScript

笑着哭i 提交于 2019-12-10 10:11:32
问题 I am working on a Firefox add-on that will allow users (all of whom are part of a specific group; this add-on is very limited in audience scope) to see the status of their authentication cookie from the status bar. We all have to authenticate to access work-related sites, but we get no warning when the cookie expires, so this causes annoying and sometimes drastic interrupts in work flow. Eventually, this add on will allow us to submit our credentials from the status bar without having to go

Firefox addon - how to listen to a text highlight event in a webpage

故事扮演 提交于 2019-12-09 19:36:24
问题 I am writing an addon which needs to do capture the no of times someone has highlighted any text on a webpage. Is there any way I can listen to this event? Thanks, Kapil 回答1: There is not a particular event for this. But you can listen to the mouseup event and check whether the selection returned by window.getSelection() is not empty and/or whether it differs from the previous selection. 回答2: You could add a selection listener. The Source window (viewSource.js) does this so that it can keep

Is there a way to run ActiveX components in Firefox through the use of a plugin?

不羁岁月 提交于 2019-12-09 12:11:42
问题 I have an ActiveX plugin that we need (if possible) to run in Firefox. Is there a plugin (or other way) for Firefox that will allow this? 回答1: I seem to have found a solution: http://code.google.com/p/ff-activex-host/ "This Firefox plugin makes it possible to use ActiveX controls in Firefox. It is based on the Gecko NPAPI and provides full access to the hosted control (events, functions, properties)." 回答2: You used to be able to in Firefox 1.5 but not any longer I believe, the plugin doesnt

Can I use LESS with Xul?

烂漫一生 提交于 2019-12-08 19:46:27
问题 Can I use LESS with Xul? Does anyone already used them together? 回答1: I haven't seen anyone use it, but nothing stops you from trying. LESS is just a preprocessor, which outputs CSS files, so the kind of problems you could expect to find should be with Mozilla-specific CSS constructs, that you might need to use. I bet any such problems would not be very hard to fix. On the other hand, unless you're working on something as complex as writing a theme from scratch, I wouldn't expect LESS to

br or newline in XUL

时间秒杀一切 提交于 2019-12-08 08:17:04
问题 How to move text to a new line in XUL without html:br ? is there a newline character in XUL or something like this? <description> Some text here </description> 回答1: The <description> element can respect line breaks, the same as <html:p> . You simply have to use the white-space CSS property: <description style="white-space: pre-wrap;"> Some text here </description> 来源: https://stackoverflow.com/questions/10031215/br-or-newline-in-xul

Get current url when changing tabs in xul in firefox

﹥>﹥吖頭↗ 提交于 2019-12-08 08:03:48
问题 I am trying to get the current URL after changing tabs in Firefox. Is it possible? 回答1: A complete example that logs the current URL to the Error Console each time a new tab is selected: function LOG(msg) { var consoleService = Components.classes["@mozilla.org/consoleservice;1"] .getService(Components.interfaces.nsIConsoleService); consoleService.logStringMessage(msg); } function onTabChange() { var href = gBrowser.contentDocument.location.href; LOG(href); } window.addEventListener("load",

How to stop firefox from downloading and applying CSS via a firefox extension?

大憨熊 提交于 2019-12-08 05:07:53
问题 Thanks to everyone in advance - So I have been banging on this issue for quite a while now and have burned through all my options. My current approach to canceling css requests is with nsIRequest.cancel inside of nsIWebProgressListener.onStateChange. This works most of the time, except when things are a little laggy a few will slip through and jump out of the loadgroup before I can get to them. This is obviously a dirty solution. I have read through the following links to try and get a better

xul:panel position on multiple monitors

懵懂的女人 提交于 2019-12-08 00:02:12
问题 I have a xul:panel on my firefox extension. I give the position to display acording to screen.width and screen.height. My problem appears when I have multiple monitors and I start the browser on the first monitor, it appears on the second one and the xul:panel is drawn according to the first screen's resolution on the second one. Is there a solution to draw according to the second screen's resolution? 回答1: Background: When I was developing a mutli-monitor application based on XULRunner for