xul

Accessing cookies, hopefully in JavaScript

大憨熊 提交于 2019-12-05 21:07:08
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 to do any reloads or redirects, but for now, I just want to see it show the status. I have been looking

Single-file app with xulrunner - possible?

女生的网名这么多〃 提交于 2019-12-05 19:39:41
I have tried to mess with xulrunner before, and now I'm trying once again :) The "real" tutorial ( Getting started with XULRunner - MDN ) does, in fact, show that one is supposed to have application.ini and other files ( possibly zipped as .xpi, which then requires --install-app ... ), and then the call should be like: xulrunner `pwd`/application.ini ... however, I'd like an easier way to start up - and hence, my hope for single-file XUL application approach :) ( A good note here is that one also cannot use the zipped .xpi as an argument to xulrunner , see XULRunner question - DonationCoder

getElementsByTagName (“div”).length returns zero for any webpage

我怕爱的太早我们不能终老 提交于 2019-12-05 19:36:00
I am trying to develop a Firefox extension. The following code: var divList = document.getElementsByTagName("div") ; Components.utils.reportError("num of divs = " + divList.length) ; Always says:- num of divs = 0. I don't understand what is the mistake that I am making in this simple piece of code. When I replace "div" with "*" , I always get a value around 1100 on any webpage. icyrock.com Not sure what is the difference in the extension context, but it might have to do with namespaces - https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByTagName . What is the tag of the

How to get text from Address Bar in Firefox extension

拟墨画扇 提交于 2019-12-05 18:24:03
问题 I am building a Firefox Extension . I am using XUL and Javascript to do this. I need to get the text from my Firefox browser's address bar. Please don't get confused with URL where the browser has navigated, its just the text that user enters before the page redirects. Suppose user is at http://www.myexample.com or whatever page. Now he types Cricket in the Address Bar and as soon as he hits enter, I want to capture the text ("Cricket") from the address bar . I need this data to do some

jsctypes - problems using SHChangeNotifyRegister for MEDIA/DRIVE events

谁说胖子不能爱 提交于 2019-12-05 09:27:00
I'm trying to use js-ctypes in Firefox to receive USB media/drive notifications, but I'm having a few issues and I can't tell if it's because I'm very inexperienced at Win32 API or awful at js-ctypes (or both!) I've started by adapting an example I found on Alexandre Poirot's blog: Blog Entry Full JS Source That example uses js-ctypes to create a "message-only" window, and then interacts with the shell service for the purpose of communicating with the Windows notification tray. It seems simple enough, so after some research on the merits of RegisterDeviceNotification vs SHChangeNotifyRegister

How to map response to request when using “http-on-modify-request” and “http-on-examine-response”?

若如初见. 提交于 2019-12-05 02:44:50
问题 How to map incoming responses to the outgoing requests when using HTTP observers: https://developer.mozilla.org/en/Setting_HTTP_request_headers#Observers ? 回答1: Compare nsIHttpChannel objects, like HttpFox does: getPendingRequestForRequestEvent: function(request) { // check for matching request for (var i = 0; i < this.Requests.length; i++) { if (request.HttpChannel === this.Requests[i].HttpChannel) { return i; } } // no match found return -1; }, 来源: https://stackoverflow.com/questions

Is this a known issue in firefox extensions on Mac OS?

女生的网名这么多〃 提交于 2019-12-04 19:04:36
I've developed a firefox extension which contains a small dialog defined by this XUL script: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <prefwindow id="firenowPreferences" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="Fire.Now" ondialogaccept='onSave();' onload="checkFields();"> <script type="application/x-javascript">function onSave(){ alert('blablabla');}</script> <prefpane id="pane1"> <grid> <rows> <row align="center"><label control="username">Username</label><textbox id="username"/></row> <row align=

How to add UI elements from a bootstraped Firefox addon

a 夏天 提交于 2019-12-04 18:48:15
I am writing a Firefox addon for Firefox 4 which allows you to create bootstraped addons (addons that do not require a restart of the browser), however, they do not allow you to use XUL to create UI elements. What is an easy way to create UI elements in places like the tools menu (with JavaScript), and how do I make my addon open a new window to interface with the browser? It's not easy right now. You need to keep track of browser windows as they open and close and add your UI to each window manually via DOM APIs See how it's implemented in the Addon (formerly Jetpack) SDK: https://github.com

How to create hidden Firefox Extension?

痞子三分冷 提交于 2019-12-04 18:37:15
Is it possible to create Firewox extension that will not shown in Extensions List? And so cannot be deinstalled manually? 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 implemented by Mozilla first. To Hide an extensions/addons in the list of extension about:addons simply follow

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

好久不见. 提交于 2019-12-04 16:08:33
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 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. You could add a selection listener. The Source window (viewSource.js) does this so that it can keep the row and column number up-to-date. 来源: https://stackoverflow.com/questions/4619298/firefox-addon-how-to-listen