xul

Using MozMill for testing standalone XUL applications

六眼飞鱼酱① 提交于 2020-01-06 08:28:46
问题 As a follow-up of this question, I am trying MozMill for testing standalone XUL applications (not a firefox extension). However, I did not "get it" yet - more specifically, how to test a XULRunner-based application. Consider this app, for example. For now, I can run it from command line, more or less this way: $ /path/to/xulrunner /full/path/to/mozmillexample/application.ini I would like to write Mozmill scripts to test it. For example, I would like to write a test such as this one, which has

Opening a window in XUL

泪湿孤枕 提交于 2020-01-06 08:15:56
问题 An exception is being thrown when trying to open a window using window.open in XUL. The exception details: Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMJSWindow.open]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: The line of code throwing the exception is: newWind = window.open(settings.url, "Dialog", "chrome = yes, width=" + settings.width + ",height=" + settings.height + ",resizable = yes,scrollbars=yes"); Can anyone please tell me how to get

XUL implicit elements

[亡魂溺海] 提交于 2020-01-06 08:14:49
问题 I've been playing around with buttons in XUL. I discovered that when you put an image on a button it creates an image element inside that button, I know this, because I can style that image with the CSS selector 'button image'. So, my question is what other implicit elements are there? I want to have a white menu arrow and I can't work out what its called. 回答1: They are called "anonymous nodes" and you can see them in DOM Inspector for example. If you prefer to inspect them programmatically,

XUL: Getting drop target ID

北慕城南 提交于 2020-01-06 04:50:26
问题 The following code is used for listbox items supposed to get the ID of the source and target items. It works for getting the source and stores it in the data variable. But data2 only retrieves the ID if the target list item is empty. If the target has text it doesn't work. How can I get the id of the list item and not the tags inside the list item? Thanks. drop: function(event){ var data = event.dataTransfer.getData("text/plain"); var data2 = event.target.id; alert("DROPPED: "+data+" "+data2)

Prevent target=“_top” from taking over UI in Mozilla Chromeless

天涯浪子 提交于 2020-01-06 02:37:26
问题 I know a fix for this is coming soon; I'm just hoping to get a head start. Chromeless is basically Firefox without it's UI. You can build your own UI using HTML, CSS, and javascript. Tabs/windows are loaded in iframes. The main frame (the browser UI) has special priviledges that allow it to control the iframes. The iframes think they are the "top" document ( top === self ). There have been a couple issues with the way they have implemented these sandboxed iframes. One of which is that links

Getting the contents of the toolbar search box using the Mozilla Firefox Add-on SDK

。_饼干妹妹 提交于 2020-01-05 08:27:29
问题 I am developing a Firefox addon and I was wondering how to get the contents of the search box in the toolbar using the Mozila Addon SDK? I finally found the chrome URL where it resides (at least I think: chrome://browser/content/search/...), but I’m still a little unsure as to how to reference this to get the contents of the search box into my addon. I tried: document.getAnonymousElementByAttribute(this, "anonid", "searchbar-textbox"); but this gives a “document is not defined” error,

How do I retrieve an XUL element’s actual width and height?

给你一囗甜甜゛ 提交于 2020-01-04 02:54:06
问题 I wanna get the actual width of a <xul:hbox> element for presentation. How can I get it? I see HTML element has offsetWidth attribute but I can't find this attribute in XUL element 回答1: Using element.getBoundingClientRect() or the older element.boxObject.width . 来源: https://stackoverflow.com/questions/1997419/how-do-i-retrieve-an-xul-element-s-actual-width-and-height

How to set an XUL key dynamically and securely?

北慕城南 提交于 2020-01-03 18:33:36
问题 I am trying to create a key element dynamically for my bootstrapped add-on. Currently, I create a keyset element and append it to document.getElementById('mainKeyset').parentNode with appendChild() and then create the key element ( myKey ) and append it to the keyset . I set the key 's id , modifiers , and key attributes and then do myKey.addEventListener('command', function() {myFunction()}); to add a function to the key . After this, I can successfully call myFunction() by doing myKey

Firefox bootstrapped extension: Get native HWND handle of the browser window

被刻印的时光 ゝ 提交于 2020-01-03 03:20:29
问题 I have an external application and I want it to display some information on top of the browser window. My bootstrapped extension needs to pass the browser window handle (native HWND) to my application, along with some other useful information about the window. I'm able to do the communication between them, the only thing that is missing is a way to get the native HWND of the Firefox window. I read a lot about it and although I belive it's possible, I couldn't find a working solution. Here's

firefox add-on shortcut does not work anymore

送分小仙女□ 提交于 2020-01-03 02:59:06
问题 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 回答1: 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