2011-09-28 04:15:06 +09:00
|
|
|
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
2011-09-07 07:00:24 +09:00
|
|
|
let Cc = Components.classes;
|
|
|
|
let Ci = Components.interfaces;
|
|
|
|
let Cm = Components.manager;
|
|
|
|
let Cu = Components.utils;
|
|
|
|
|
2011-09-28 04:15:06 +09:00
|
|
|
Cu.import('resource://gre/modules/Services.jsm');
|
2011-09-07 07:00:24 +09:00
|
|
|
|
|
|
|
function log(str) {
|
2011-09-28 04:15:06 +09:00
|
|
|
dump(str + '\n');
|
|
|
|
}
|
2011-09-07 07:00:24 +09:00
|
|
|
|
|
|
|
function startup(aData, aReason) {
|
2011-09-28 04:15:06 +09:00
|
|
|
let manifestPath = 'chrome.manifest';
|
|
|
|
let file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsILocalFile);
|
2011-09-07 07:00:24 +09:00
|
|
|
try {
|
|
|
|
file.initWithPath(aData.installPath.path);
|
|
|
|
file.append(manifestPath);
|
|
|
|
Cm.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(file);
|
2011-09-28 04:15:06 +09:00
|
|
|
} catch (e) {
|
2011-09-07 07:00:24 +09:00
|
|
|
log(e);
|
|
|
|
}
|
2011-09-28 04:15:06 +09:00
|
|
|
}
|
2011-09-07 07:00:24 +09:00
|
|
|
|
|
|
|
function shutdown(aData, aReason) {
|
2011-09-28 04:15:06 +09:00
|
|
|
}
|
2011-09-07 07:00:24 +09:00
|
|
|
|
|
|
|
function install(aData, aReason) {
|
2011-09-28 04:15:06 +09:00
|
|
|
let url = 'chrome://pdf.js/content/web/viewer.html?file=%s';
|
|
|
|
Services.prefs.setCharPref('extensions.pdf.js.url', url);
|
|
|
|
}
|
2011-09-07 07:00:24 +09:00
|
|
|
|