xul

XULRunner: Prevent links to arbitrary domains

核能气质少年 提交于 2019-12-07 21:07:14
问题 suppose, we have a Mozilla Prism like XULRunner app. There is a XUL window with a <browser/> element, where the browser shows a web page on a given domain (say, example.com). Now there are several links on example.com. If a user follows a local link (i.e., stays on example.com) she should be allowed to follow. If on the other hand the link goes to elpmaxe.moc, there should be (I don't mind) any of those two possibilities: The "real" browser opens (just like in Prism), or nothing happens. Any

jQuery for XUL?

淺唱寂寞╮ 提交于 2019-12-07 19:38:05
问题 I have read on the internet and found out that jQuery works OK on XUL. My questions are: Are there any jQuery plugins that are specially made to work with XUL? Is there any other jQuery-like library that was specially made for XUL? I have not yet tested jQuery on XUL, I'm just asking these questions for curiosity. 回答1: Relevant SO question: Is it possible to use jQuery to manipulate XUL elements? 回答2: <!-- language: lang-js --> <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet href=

XUL prefwindow size problems

≯℡__Kan透↙ 提交于 2019-12-07 17:40:28
问题 I have a Firefox add-on with a <prefwindow> to control the preferences for my add-on. It contains 2 separate <description> tags to provide more info at certain places (see below). I have some JavaScript that I run when the dialog loads to set a CSS max-height and max-width based on the dimensions of the user's screen (I found this necessary because otherwise the dialog would expand horizontally past the edges of the screen just so the one <description> (which has CSS word-wrap: break-word set

How to place a Xul window as “Always On Top”?

拥有回忆 提交于 2019-12-07 15:39:36
问题 I found this file at google code with the function: function SetAlwaysOnTop() { var chkTop = document.getElementById("itmAlwaysOnTop"); var xulWin = window.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIWebNavigation).QueryInterface(Ci.nsIDocShellTreeItem) .treeOwner.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIXULWindow); if(chkTop.getAttribute("checked") == "true") { xulWin.zLevel = xulWin.raisedZ; } else { xulWin.zLevel = xulWin.normalZ; } } The parts of it

How to run a XUL application in Mac OS X Snow Leopard?

一曲冷凌霜 提交于 2019-12-07 15:07:06
问题 I am trying to create a XUL "Hello World" application in Mac OS X. I download the XULRunner from here, followed this tutorial and then this tutorial and then this tutorial... None worked. So, I looked at it better and found this section, whose instructions I followed. Unfortunately, it does not work yet. I even can run the application with the command /Library/Frameworks/XUL.framework/xulrunner-bin $PWD/application.ini However, no window is presented and no error is printed. It happens when I

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

巧了我就是萌 提交于 2019-12-07 13:16:25
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 idea of how to disable css before a nsIRequest is created...no dice. https://developer.mozilla.org/en

Can I have an XUL panel without a shadow in my Firefox extension?

丶灬走出姿态 提交于 2019-12-07 02:19:52
问题 XUL panels in a Firefox extension overlay always come with a shadow for free. How can I remove this shadow? Example code for the shadow effect I don't want: <popupset> <panel id="popuppanel" width="500" noautohide="true"> <vbox> <label value="test"/> <label value=""/> <label value=""/> <label value=""/> </vbox> </panel> </popupset> And a screenshot: Example image of shadow effect I don't want. http://img124.imageshack.us/img124/7766/shadowj.png 回答1: Use the following CSS statement: -moz

firefox add-on shortcut does not work anymore

假如想象 提交于 2019-12-06 15:34:09
I have used following commands in my browser.xul to set a shortcut for my addon. <keyset id="mainKeyset"> <key id="key_convert" modifiers="accel" keycode="VK_F12" oncommand="myfunction()" />" </keyset> It used to work for previous versions of Firefox, but not anymore for newer versions. has anything changed in the syntax? Thanks That code example looks correct, I suspect that there is some code within myfunction() that is failing, so we need more information probably. Try to replace myfunction() with alert("test") , that should work. Noitidart Some notes: You must add it to a keyset, as the

Scope of JavaScript variables (XUL-related)

纵饮孤独 提交于 2019-12-06 15:14:56
A beginner's question, probably a trivial one. Here's the XUL code snippet: <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://.../main.js"/> <button label="Click me!" oncommand="clickhandler()"/> </window> The JavaScript code: // main.js var test = "Peanut butter"; // a global variable function clickhandler() { alert(test); } The interpreter processes the JavaScript file just after reading the main window's opening tag and then proceeds with the rest of XUL code. In my opinion, the test variable should go out of

How to add UI elements from a bootstraped Firefox addon

有些话、适合烂在心里 提交于 2019-12-06 12:27:24
问题 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? 回答1: 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