问题
when I'm writing extension for Google Chrome, I only create "manifest.json" file and JS file, which is my script. after installing , I can change anything in the code, I only refresh browser and I had changed version of extension.
1) Can I change some code after installing Firefox extension? Or should I reinstall it? Or should I need to reload it again - and how if its possible?
2) should I create install.rdf, chrome.manifest, *.xul files and so in by hand (whick folder structure and so on)? Or is there another simplest way to do this?
3) I don't understand, should i create extensions by "Add-on SDK" or write by hand with notepad? what is difference of them?
4) I'm writing simplest script, which invoke alert('hello world') when i open any page by browser. what is the best and fastest way to do this?
thanks a lot;
回答1:
1) Can I change some code after installing Firefox extension? Or should I reinstall it? Or should I need to reload it again - and how if its possible?
Live updates are possible using <em:bootstrap>true</em:bootstrap> and bootstrap functions
2) should I create install.rdf, chrome.manifest, *.xul files and so in by hand (whick folder structure and so on)? Or is there another simplest way to do this?
Neither; modify an existing simple extension
3) I don't understand, should i create extensions by "Add-on SDK" or write by hand with notepad? what is difference of them?
Add-on SDK is an sdk; by hand is xul; depends on you
4) I'm writing simplest script, which invoke alert('hello world') when i open any page by browser. what is the best and fastest way to do this?
hello_world.xpi (chrome / content / hello.xul):
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<caption label="Hello World"/>
</window>
In addition, extension development tools should help.
References
- Explore multithreaded programming in XUL
来源:https://stackoverflow.com/questions/14959858/firefox-extension-testing-and-developing-im-confused