Friday, 15 June 2012

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


A recent friend of mine and I'm working on Firefox extension. He handed me the code today, and I am trying to restart it. I used the tutorial because I do not normally have the experience of working with JavaScript and extensions, so I was thinking that anyone could help understand the meaning of this tutorial. They are saying that we can not use "more XUL overlay", and I understand it. What I do not understand is how to do this part:

Find out which XUL elements you need to create for your add-ons, where they are located in the XUl Need to go to the window, and how to do it docs: ,,, (DOM elements are also nodes).

I decided to use the document. LoadOverlay, because it's a very buggy I'm not sure that it helps a lot, but here's the code for our overlays. Xul again, sorry if the question is really original, then some help is greatly appreciated. If I need to provide more code, please tell me at this point I thought that only code for our overlay Xul file is important.

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Overlay id = "my-overlay" xmlns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" & gt; & Lt; Script type = "app / javascript; version = 1.7" src = "overlay.js" /> & Lt; / Overlay & gt; The XUL overlay can be used for various types of things in Firefox.  

Other possible uses of the overlay (such as loading script, as you do Are more focused on the UI elements than the ones).

In an XUL overlay extension, the UI element is usually added by providing an XUL overlay file for each part of the interface which is modified XUL overlay extension does not need to consider removing the interface elements , Because they are only deleted when the extension is removed or disabled.

In a resume extension, all UI elements are expanded each time it is started. Some UI elements are added once; And some should be added to each open window and when every new window is opened. When the extension is disabled, or deleted, the UI elements should be programmatically removed completely from Firefox.

The part you quoted is trying to describe the process of converting the actual XUL overlay (Firefox UI) to programmatically insert (and delete) UI elements. The most common UI element is probably a toolbar button, but it can be anything because it can be anything, the details are relatively obscure.

This entire section, of course, could use some detail. I remember planning to do this on the basis of the code I used when converting an extension to the overlay from the XL to the overlay. I wanted to clean up the code slightly, and for more cases, though, it would be helpful to have an example in it. I will see if I can update it next week (if someone does not kill me)

In your case: Overlay code based on the language that you were involved in your question, this section is not directly talking as if you have your XUL overlay How are you doing the experiment, as you might have desired, the part you have cited:

To add your Explorer, the XUL elements need to be created for your add-on , Where it should go in the XUL window, and how to do it. Docs: [document.getElementByID ()] [3], [document.createElement ()] [4], [Element Reference] [5], [node reference] [6] (DOM elements are also nodes).

Specifically talking about linking UI elements in Firefox, which you are not doing with your overlay.

What you need to do is decide how you are going to apply your script, overlay.js , remember whatever you are adding to it , When your extension is disabled / removed / updated, you should also be able to delete it.

To provide more detailed information, we need to know what you are adding to your script, let us include a copy of your chrome.manifest file. the wanted. The functionality can be more appropriately controlled without implementing the script in the manner contained by the overlay, to find out what your script is useful. However, you should ask it as a new, separate question, do not modify this question to ask something different.


No comments:

Post a Comment