Initial import of the Firefox extension

This commit is contained in:
Vivien Nicolas 2011-09-07 00:00:24 +02:00
parent 5e37bf7aeb
commit e18ddc9c97
5 changed files with 230 additions and 0 deletions

31
extensions/firefox/bootstrap.js vendored Normal file
View file

@ -0,0 +1,31 @@
let Cc = Components.classes;
let Ci = Components.interfaces;
let Cm = Components.manager;
let Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");
function log(str) {
dump(str + "\n");
};
function startup(aData, aReason) {
let manifestPath = "chrome.manifest";
let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
try {
file.initWithPath(aData.installPath.path);
file.append(manifestPath);
Cm.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(file);
} catch(e) {
log(e);
}
};
function shutdown(aData, aReason) {
};
function install(aData, aReason) {
let url = "chrome://pdf.js/content/web/viewer.html?file=%s";
Services.prefs.setCharPref("extensions.pdf.js.url", url);
};