xul

Dispatch CustomEvent() to prefwindow - Firefox addon

∥☆過路亽.° 提交于 2019-12-25 06:30:51
问题 Working with a Firefox addon, I wish to send a CustomEvent() to a preference window. I open the preference window using an openDialog(), and keep a reference to the opened window. After that, I try to dispatch the event, but the event is never received. var pWin = window.openDialg("chrome://myextension/path/options.xul", "name", features); var event = new pWin.CustomEvent("prefwindow-event"); pWin.dispatchEvent(event); In the prefwindow scope, I have this code in the XUL attached script :

How to embedded a link in a XUL treecell?

◇◆丶佛笑我妖孽 提交于 2019-12-25 05:32:58
问题 The question is simple. I want to put a link in a XUL treecell. thanks 回答1: I've only gotten this to work with onclick events: <text value="http://getsatisfaction.com/" class="url" onclick="window.open('http://getsatisfaction.com/');"/> And, of course, these should probably be applied via js instead of hard-coding. hrm. Mozilla docs give an alternate example: <label href="http://`enter code here`example.com" class="text-link" value="Click here to go to example.com"/> 来源: https://stackoverflow

What does paragraph about figuring out XUL elements mean in MDN document: “How to convert an overlay extension to restartless”

泄露秘密 提交于 2019-12-24 14:26:39
问题 Recently a friend of mine and I have been working on a Firefox extension. He handed the code to me today, and I've been trying to make it restartless. I used the tutorial from How to convert an overlay extension to restartless (on MDN). Since I don't have much experience working with JavaScript and extensions in general, I was wondering if anyone could help to understand what step number 6 means here in this tutorial. They are saying we can't use "no more XUL overlays", and I understand this.

how to run a .exe file in xul application?

北战南征 提交于 2019-12-24 10:38:08
问题 i want make a app with xul but some functions and logic in a stable exe file. run the exe with xulapp that to do something and get the result given to the xul application, how should i do ,thanks 回答1: You can invoke another application using nsIProcess, but you can't easily obtain a result, except for the exit value. Attempts are being made to get a proper IPC component that will allow you to write to the process stdin and read from its stdout and stderr but this is not yet available in

xul/xpcom copy image from string to clipboard

天大地大妈咪最大 提交于 2019-12-24 00:54:56
问题 I'm stuck with no clues how to copy image to clipboard. My code looks like this: var image = "data:image/png;base64,..." var io = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); var channel = io.newChannel(image, null, null); var input = channel.open(); var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable); trans.addDataFlavor("image/png"); trans.setTransferData("image

Get PostData as in FireBug

孤街浪徒 提交于 2019-12-23 17:53:08
问题 Anyone, help me, how to get Headers and PostData inside extension, using xpcom/something else? i cant find functions inside firebug due to it is big codebase... thank you guys 回答1: I am assuming that you want request headers, not response headers. Then you register an observer for the http-on-modify-request notification. The general documentation is https://developer.mozilla.org/en/Observer_Notifications#HTTP_requests, a code example can be found under https://developer.mozilla.org/en

Get menuitem from context menu in firefox

与世无争的帅哥 提交于 2019-12-23 05:25:46
问题 I've written a Firefox extension which appends a menuitem onto the context menu and now i want to hide the item unless context of the click is on text. For some reason the oncontextmenu event is never triggered ('context opened' is not shown on screen). I've tried changing the to but still no alert being fired, anyone got an idea what i might be doing wrong here? thanks! <?xml version="1.0"?> <overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script> function

Query URL for Log In Status, javascript

时光毁灭记忆、已成空白 提交于 2019-12-23 03:39:28
问题 This may seem like a no-brainer, but I can't find a way to do this that isn't considered a security issue (other than the obvious ways)... So, I want to build an add-on for Firefox to use with my team. Basically it will be a status bar icon letting us know if the authentication cookie for our tools site has expired, so we can tell without losing any work currently in the browser. At first I thought I could have the add-on check the cookie, but this seems to be a huge hassle for such a simple

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

别等时光非礼了梦想. 提交于 2019-12-22 10:29:29
问题 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. 回答1: Not sure what is the difference in the extension context, but it might have to do with namespaces - https:/

jsctypes - problems using SHChangeNotifyRegister for MEDIA/DRIVE events

≡放荡痞女 提交于 2019-12-22 05:57:36
问题 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