I will help you with issues that are familiar to me (Javascript-based add-ons), and suggest some suggestions for other parts. Nothing happens here!
Additions
Firefox add-ons easily provide the tools you need to detect page loading and open / close firefox.
To detect page loading , you can register a listener in the DOMContentLoaded event in a window.
window.addEventListener("DOMContentLoaded", function(event){
var url = event.originalTarget.location.href;
alert("Oh yeah, a document is loading: " + url);
}, false);
Alternatively, you can register nsIWebProgressListener to listen for location changes . This is probably closer to what you want, as it DOMContentLoadedalso runs for iframes.
var listener = {
onLocationChange: function(aWebProgress, aRequest, aLocation){
var url = aLocation.asciiSpec;
alert("Oh yeah, a the location changed: " + url);
}
};
gBrowser.addTabsProgressListener(listener);
firefox open/close, , Firefox . firefox, . , , firefox windows , :
window.addEventListener("load", function(event){
alert("Looks like you just opened up a new window");
}, false);
window.addEventListener("unload", function(event){
alert("Awh, you closed a window");
}, false);
, , / firefox . , Javascript Modules. Javascript . , . .
var EXPORTED_SYMBOLS = ["windowOpened", "windowClosed"];
var windowsOpened = 0;
function windowOpened(){
if( windowsOpened === 0) {
alert("The first window has been opened!");
}
windowsOpened++;
}
function windowClosed(){
windowsOpened++;
if( windowsOpened === 0) {
alert("The last window has been closed!");
}
}
, 2 load unload.
, , Firefox. , Mozilla Addon Builder, . ( Javascript) ff-overlay.js( ).
#
#. , , SO .
, COM- - Windows. , Binary Component . , , , javascript. Mozilla Visual Studio.
, SDK, javascript. , , , sqlite .. SO > , . , .
(1), , . (2), IPC, . (3) , ( , Distributed Systems ).
TL;DR
. Addon Builder, FF , .
# SO-. sqlite , .