xul

Disabling hotkeys in firefox addon

醉酒当歌 提交于 2019-12-11 04:28:06
问题 Is there a way to disable keyboard shortcuts (hotkeys) in a firefox add-on? 回答1: If your addon has an overlay for browser.xul, an alternative to handling the "keypress" event is to use script in the "load" handler to remove the relevant elements from the browser XUL document like this: var key = document.getElementById("key_openDownloads"); key.parentNode.removeChild(key); In case it's not obvious, this removes the hotkey for opening the download manager. You can see all the keys here: http:/

How to overlay an XUL file from another extension in a bootstrapped add-on (or otherwise modify the DOM of the XUL file)?

痴心易碎 提交于 2019-12-11 03:56:26
问题 I want to add some DOM elements to another extension's XUL file. That extension allows itself to be "opened" by clicking on a toolbar button that it adds to Firefox. Clicking on this button opens a new tab with the chrome address of an XUL file that is part of the extension. I have already created some DOM elements dynamically and added them to elements on the Firefox window (e.g. the previously mentioned toolbar) by both adding them when my add-on is loaded and using window "load" event

Open links in new tab in Firefox

喜夏-厌秋 提交于 2019-12-11 03:53:09
问题 I am developing an Firefox extension. How can all the links on a webpage to be opened in a new tab? 回答1: That's usually a configurable option in Firefox to handle new links, so they may override your extension with that. However... The code <a href="http://www.example.com/"> Example Website</a> will allow you to click the appearing words [Example Website], and the link will open in the current window. The code <a href="http://www.example.com/" target="_blank"> Example Website</a> Opens the

How are firefox notifications implemented?

风流意气都作罢 提交于 2019-12-10 23:21:45
问题 I would like to implement a notification mechanism in a firefox extension equal to firefox's "save password" option or popup blocking warning with the yellow bar sliding in above the main window. Does anybody now how this can be achieved in XUL? Thanks for any help. 回答1: You'll want to use the notifcationbox element for this. 回答2: Thanks to the hint of sdwilsh, a wrote the following code to achive my goal: var notificationBox = gBrowser.getNotificationBox(); notificationBox.appendNotification

In xul, how to retrieve an environment variable?

一个人想着一个人 提交于 2019-12-10 23:13:05
问题 I have an environment called $REP , how can I access the value of this variable using Xulrunner in a Linux environment? --udpate attempting with nslEnvironment: var env = Components.classes["@mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment); dump("bash=" + env.exists("BASH") + '\n'); dump("bash=" + env.exists("$BASH") + '\n'); the output was: bash=false bash=false as you imagine, it should output "/bin/bash" as it does in the terminal. I also tried using

How to manipulate window prototype in a <browser> element?

本秂侑毒 提交于 2019-12-10 12:08:38
问题 What I'm doing right now is: When <browser src="..." /> loads, I attach data into its .contentWindow : frame.addEventListener("load",function(){ this.contentWindow.someMethod = function(){}; },true); Now I want to know if there is a way to do this earlier, into the <browser> 's window prototype, or any Window prototype, as for example I can do in the "current" window: // [W]indow is the constructor Window.prototype.test = function(){ alert("hello"); }; // [w]indow is the instance window.test(

Get the visible range in Firefox

丶灬走出姿态 提交于 2019-12-10 11:57:39
问题 Is it possible to get the current viewport Range (the visible part of the page inside the browser) using XUL functions from Javascript or plain Javascript? Thank you! 回答1: For the viewport you need to use document.documentElement.scrollTop / scrollLeft / scrollHeight / scrollWidth . There is a slight complication: I think that in quirks mode ( document.compatMode is "BackCompat" ) you need to check these properties on document.body instead of document.documentElement . See https://developer

Forcing a description widget to wrap

妖精的绣舞 提交于 2019-12-10 11:05:41
问题 I am trying to get a description in a XUL application to wrap, even if it contains long lines. For example, if I save the following as a .xul file and open it in Firefox, it looks fine and wraps appropriately: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="theWindow" title="The Window" style="overflow: auto;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml" > <vbox flex="1" style=

Is it possible to use local resources from a web-delivered XUL app?

…衆ロ難τιáo~ 提交于 2019-12-10 11:04:13
问题 Is there a way to execute a XUL program delivered via "trusted" web site outside of the browser sandbox? My XUL program executes beautifully in local XULRunner and in firefox with the -add parameter. Now, I'd like to put it on my secure intranet and allow users to click a button which will launch it. My app has behaviors that access local resources such as .exes, so it seems like the browser sandbox will prohibit the app from carrying out those behaviors. But I'd really like to create a

XUL button doesn't appear

我是研究僧i 提交于 2019-12-10 10:33:44
问题 I'm one of the developers of TryAgain, a Firefox add-on, that displays a custom error page when a website fails to load. It essentially replaces Firefox's netError.xhtml with a customized version. However, I've run in to some fairly terminal compatibility problems between 3.0.*-3.6.* and Fx4b5. (An entry in netError.dtd has been renamed, causing a XML parse error in either one version or the other.) To fix this, I've decided to have the extension dynamically modify the page, opposed to