xul

Thunderbid extension: open eml file

六月ゝ 毕业季﹏ 提交于 2019-12-13 02:42:10
问题 I already created an extension that does the following: When I run Thinderbird with the command line thunderbird -MyCustomParam1 "12345" my extension will open a compose window and add the parameter "12345" to the window. Some code that I use: // In the calling code var args = { param1: 12345, }; args.wrappedJSObject = args; var watcher = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getService(Components.interfaces.nsIWindowWatcher); watcher.openWindow(null, url, windowName,

I add 10 functions to a code, I don't even call any of them, but the code stops working!

早过忘川 提交于 2019-12-13 02:31:59
问题 Alone, this code works: CustomButton = { 1: function () { alert("Just testing") }, } I add the code below and the code above stops working: function getvisitingnow() { return document.location; } function getcontents(uri) { var req = new XMLHttpRequest(); req.open('GET', uri, true); req.onreadystatechange = function (aEvt) { if (req.readyState == 4) { if(req.status == 200) { return req.responseText; } } }; req.send(); } function regexforsitefound(uri, searchcontents) { var re = new RegExp("\\

FF extension: a popup with dynamic menuitems, with each menu item having another popup

帅比萌擦擦* 提交于 2019-12-12 10:24:34
问题 I am building an extension that has a popup whose elements are constructed by a function call everytime the mouse hovers over the popup option. I am able to achieve this. Now I need to have a popup for each of the menu item (inside the original popup) which is not dynamic though. I have this code, but it does not work: var myMenuPopup = document.getElementById("file-popup4"); for (var m=0; m<localpubliclist.length; m++) { var newItem = document.createElement("menupopup"); newItem.setAttribute

How to know if the network is (dis)connected?

两盒软妹~` 提交于 2019-12-12 08:31:02
问题 How can I know, in Xul, if the network is (dis)connected? --update Using: function observe(aSubject, aTopic, aState) { if (aTopic == "network:offline-status-changed") { write("STATUS CHANGED!"); } } var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); os.addObserver(observe, "network:offline-status-changed", false); and the preference: pref("network.manage-offline-status", true); it's not working.. There's a bug report here, but

Simplest way to launch Firefox, drive 3rd party site using privileged nsI* APIs

时光毁灭记忆、已成空白 提交于 2019-12-12 08:16:30
问题 What's the simplest way to launch Firefox, load a 3rd party website (which I'm authorised to "automate"), and run some "privileged" APIs against that site? (e.g: nsIProgressListener, nsIWindowMediator, etc). I've tried a two approaches: Create a tabbed browser using XULrunner, "plumbing" all the appropriate APIs required for the 3rd party site to open new windows, follow 302 redirects, etc. Doing it this way, it's an aweful lot of code, and requires (afaict) that the user installs the app, or

How to replace a javascript file request with contents from another file in a FF addon?

梦想的初衷 提交于 2019-12-12 07:38:32
问题 I'm looking for some guidance on how to replace requests for a specific javascript file with another file that I'll package with the Firefox addon. 回答1: See How can I implement a content converter in Firefox for all page elements? (its scope is much wider than what you really need -- read on) on how to use registerFactory to register a surrogate HTTP protocol handler, which can then instantiate channels with alternate (e.g. file:///... -type) URIs when newChannel is called with your

How to get subchild values from parent node from XML file parsing in JavaScript in XUL

徘徊边缘 提交于 2019-12-12 05:49:20
问题 How could I parse my email values to my text box according to email type. I need some help in parsing Emails values to my text-boxes. <CONTACT> <PDE-Identity>N65567</PDE-Identity> <FirstName>Rangarajkarthik</FirstName> <LastName>karthik Rangaraj</LastName> <Facebook-ID/> <EMAIL> <Type>gmail</Type> <Value>kart06@gmail.com</Value> <Type>yahoo</Type> <Value>karthikngaraj@yahoo.com</Value> </EMAIL> </CONTACT> How can I parse the value of type to my textbox in XUL using a loop? In some contact

How can I delete item from a nested XUL tree? [closed]

拈花ヽ惹草 提交于 2019-12-12 05:37:53
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I created a nested tree using XUL (no database was used to store items). I want to delete items from this tree by selecting the item (only 1 at a time) then click delete. I wrote Javascript function to delete as

How to make a 50% transparent window?

你说的曾经没有我的故事 提交于 2019-12-12 05:35:33
问题 I'm trying to do a semi-transparent window. There's my attempt: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window width="400" height="300" style="-moz-appearance: none; background: rgba(255, 255, 255, 0.5); filter:alpha(opacity=50); opacity: 0.5; -moz-opacity:0.5;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <label value="MAIN WINDOW"/> </window> Although the text on the window is transparent, the window itself is not. I

How to properly set events for dynamic XUL elements?

戏子无情 提交于 2019-12-12 05:09:02
问题 I have a toolbar extension that generates dynamic toolbarbutton and menuitem elements. These items are typically constructed like this: tempMenuItem = document.createElement("menuitem"); tempMenuItem.setAttribute("label", "Some Label"); tempMenuItem.setAttribute("tooltiptext", "Some Tooltip"); tempMenuItem.setAttribute("oncommand", "myObject.someFunction()"); This code works just fine, but I get the following warning when I submit my extension to the official add-on repository: on* attribute