Merge pull request #4343 from brendandahl/ff-cleanup
Use only one resource url for moz central build.
This commit is contained in:
commit
192f09cd69
4
extensions/firefox/bootstrap.js
vendored
4
extensions/firefox/bootstrap.js
vendored
@ -111,13 +111,13 @@ function startup(aData, aReason) {
|
|||||||
|
|
||||||
// Load the component and register it.
|
// Load the component and register it.
|
||||||
pdfStreamConverterUrl = aData.resourceURI.spec +
|
pdfStreamConverterUrl = aData.resourceURI.spec +
|
||||||
'components/PdfStreamConverter.js';
|
'content/PdfStreamConverter.jsm';
|
||||||
Cu.import(pdfStreamConverterUrl);
|
Cu.import(pdfStreamConverterUrl);
|
||||||
pdfStreamConverterFactory.register(PdfStreamConverter);
|
pdfStreamConverterFactory.register(PdfStreamConverter);
|
||||||
|
|
||||||
if (registerOverlayPreview) {
|
if (registerOverlayPreview) {
|
||||||
pdfRedirectorUrl = aData.resourceURI.spec +
|
pdfRedirectorUrl = aData.resourceURI.spec +
|
||||||
'components/PdfRedirector.js';
|
'content/PdfRedirector.jsm';
|
||||||
Cu.import(pdfRedirectorUrl);
|
Cu.import(pdfRedirectorUrl);
|
||||||
pdfRedirectorFactory.register(PdfRedirector);
|
pdfRedirectorFactory.register(PdfRedirector);
|
||||||
|
|
||||||
|
@ -1,2 +1 @@
|
|||||||
resource pdf.js content/
|
resource pdf.js content/
|
||||||
resource pdf.js.components components/
|
|
||||||
|
@ -34,8 +34,8 @@ const PDF_CONTENT_TYPE = 'application/pdf';
|
|||||||
|
|
||||||
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
|
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
|
||||||
Cu.import('resource://gre/modules/Services.jsm');
|
Cu.import('resource://gre/modules/Services.jsm');
|
||||||
Cu.import('resource://pdf.js.components/PdfStreamConverter.js');
|
Cu.import('resource://pdf.js/PdfStreamConverter.jsm');
|
||||||
Cu.import('resource://pdf.js.components/PdfRedirector.js');
|
Cu.import('resource://pdf.js/PdfRedirector.jsm');
|
||||||
|
|
||||||
let Svc = {};
|
let Svc = {};
|
||||||
XPCOMUtils.defineLazyServiceGetter(Svc, 'mime',
|
XPCOMUtils.defineLazyServiceGetter(Svc, 'mime',
|
||||||
@ -61,39 +61,25 @@ function getIntPref(aPref, aDefaultValue) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Factory that registers/unregisters a constructor as a component.
|
// Register/unregister a constructor as a factory.
|
||||||
function Factory() {}
|
function Factory() {}
|
||||||
|
|
||||||
Factory.prototype = {
|
Factory.prototype = {
|
||||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFactory]),
|
|
||||||
_targetConstructor: null,
|
|
||||||
|
|
||||||
register: function register(targetConstructor) {
|
register: function register(targetConstructor) {
|
||||||
this._targetConstructor = targetConstructor;
|
|
||||||
var proto = targetConstructor.prototype;
|
var proto = targetConstructor.prototype;
|
||||||
|
this._classID = proto.classID;
|
||||||
|
|
||||||
|
var factory = XPCOMUtils._getFactory(targetConstructor);
|
||||||
|
this._factory = factory;
|
||||||
|
|
||||||
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
|
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
|
||||||
registrar.registerFactory(proto.classID, proto.classDescription,
|
registrar.registerFactory(proto.classID, proto.classDescription,
|
||||||
proto.contractID, this);
|
proto.contractID, factory);
|
||||||
},
|
},
|
||||||
|
|
||||||
unregister: function unregister() {
|
unregister: function unregister() {
|
||||||
var proto = this._targetConstructor.prototype;
|
|
||||||
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
|
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
|
||||||
registrar.unregisterFactory(proto.classID, this);
|
registrar.unregisterFactory(this._classID, this._factory);
|
||||||
this._targetConstructor = null;
|
this._factory = null;
|
||||||
},
|
|
||||||
|
|
||||||
// nsIFactory
|
|
||||||
createInstance: function createInstance(aOuter, iid) {
|
|
||||||
if (aOuter !== null)
|
|
||||||
throw Cr.NS_ERROR_NO_AGGREGATION;
|
|
||||||
return (new (this._targetConstructor)).QueryInterface(iid);
|
|
||||||
},
|
|
||||||
|
|
||||||
// nsIFactory
|
|
||||||
lockFactory: function lockFactory(lock) {
|
|
||||||
// No longer used as of gecko 1.7.
|
|
||||||
throw Cr.NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -131,5 +131,3 @@ PdfRedirector.prototype = {
|
|||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var NSGetFactory = XPCOMUtils.generateNSGetFactory([PdfRedirector]);
|
|
@ -959,5 +959,3 @@ PdfStreamConverter.prototype = {
|
|||||||
delete this.binaryStream;
|
delete this.binaryStream;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var NSGetFactory = XPCOMUtils.generateNSGetFactory([PdfStreamConverter]);
|
|
22
make.js
22
make.js
@ -448,7 +448,6 @@ target.firefox = function() {
|
|||||||
'*.svg',
|
'*.svg',
|
||||||
'*.png',
|
'*.png',
|
||||||
'*.manifest',
|
'*.manifest',
|
||||||
'components',
|
|
||||||
'locale',
|
'locale',
|
||||||
'../../LICENSE'],
|
'../../LICENSE'],
|
||||||
FIREFOX_EXTENSION_FILES =
|
FIREFOX_EXTENSION_FILES =
|
||||||
@ -457,7 +456,6 @@ target.firefox = function() {
|
|||||||
'chrome.manifest',
|
'chrome.manifest',
|
||||||
'icon.png',
|
'icon.png',
|
||||||
'icon64.png',
|
'icon64.png',
|
||||||
'components',
|
|
||||||
'content',
|
'content',
|
||||||
'locale',
|
'locale',
|
||||||
'LICENSE'],
|
'LICENSE'],
|
||||||
@ -480,6 +478,12 @@ target.firefox = function() {
|
|||||||
cp(FIREFOX_CONTENT_DIR + 'PdfJsTelemetry-addon.jsm',
|
cp(FIREFOX_CONTENT_DIR + 'PdfJsTelemetry-addon.jsm',
|
||||||
FIREFOX_BUILD_CONTENT_DIR + 'PdfJsTelemetry.jsm');
|
FIREFOX_BUILD_CONTENT_DIR + 'PdfJsTelemetry.jsm');
|
||||||
|
|
||||||
|
cp(FIREFOX_CONTENT_DIR + 'PdfStreamConverter.jsm',
|
||||||
|
FIREFOX_BUILD_CONTENT_DIR);
|
||||||
|
|
||||||
|
cp(FIREFOX_CONTENT_DIR + 'PdfRedirector.jsm',
|
||||||
|
FIREFOX_BUILD_CONTENT_DIR);
|
||||||
|
|
||||||
// Copy extension files
|
// Copy extension files
|
||||||
cd(FIREFOX_EXTENSION_DIR);
|
cd(FIREFOX_EXTENSION_DIR);
|
||||||
cp('-R', FIREFOX_EXTENSION_FILES_TO_COPY, ROOT_DIR + FIREFOX_BUILD_DIR);
|
cp('-R', FIREFOX_EXTENSION_FILES_TO_COPY, ROOT_DIR + FIREFOX_BUILD_DIR);
|
||||||
@ -520,11 +524,11 @@ target.firefox = function() {
|
|||||||
FIREFOX_BUILD_DIR + '/update.rdf');
|
FIREFOX_BUILD_DIR + '/update.rdf');
|
||||||
|
|
||||||
sed('-i', /PDFJSSCRIPT_STREAM_CONVERTER_ID/, FIREFOX_STREAM_CONVERTER_ID,
|
sed('-i', /PDFJSSCRIPT_STREAM_CONVERTER_ID/, FIREFOX_STREAM_CONVERTER_ID,
|
||||||
FIREFOX_BUILD_DIR + 'components/PdfStreamConverter.js');
|
FIREFOX_BUILD_CONTENT_DIR + 'PdfStreamConverter.jsm');
|
||||||
sed('-i', /PDFJSSCRIPT_PREF_PREFIX/, FIREFOX_PREF_PREFIX,
|
sed('-i', /PDFJSSCRIPT_PREF_PREFIX/, FIREFOX_PREF_PREFIX,
|
||||||
FIREFOX_BUILD_DIR + 'components/PdfStreamConverter.js');
|
FIREFOX_BUILD_CONTENT_DIR + 'PdfStreamConverter.jsm');
|
||||||
sed('-i', /PDFJSSCRIPT_MOZ_CENTRAL/, 'false',
|
sed('-i', /PDFJSSCRIPT_MOZ_CENTRAL/, 'false',
|
||||||
FIREFOX_BUILD_DIR + 'components/PdfStreamConverter.js');
|
FIREFOX_BUILD_CONTENT_DIR + 'PdfStreamConverter.jsm');
|
||||||
|
|
||||||
// Update localized metadata
|
// Update localized metadata
|
||||||
var localizedMetadata = cat(EXTENSION_SRC_DIR + '/firefox/metadata.inc');
|
var localizedMetadata = cat(EXTENSION_SRC_DIR + '/firefox/metadata.inc');
|
||||||
@ -591,6 +595,8 @@ target.mozcentral = function() {
|
|||||||
|
|
||||||
cp(FIREFOX_CONTENT_DIR + 'PdfJs.jsm', MOZCENTRAL_CONTENT_DIR);
|
cp(FIREFOX_CONTENT_DIR + 'PdfJs.jsm', MOZCENTRAL_CONTENT_DIR);
|
||||||
cp(FIREFOX_CONTENT_DIR + 'PdfJsTelemetry.jsm', MOZCENTRAL_CONTENT_DIR);
|
cp(FIREFOX_CONTENT_DIR + 'PdfJsTelemetry.jsm', MOZCENTRAL_CONTENT_DIR);
|
||||||
|
cp(FIREFOX_CONTENT_DIR + 'PdfStreamConverter.jsm', MOZCENTRAL_CONTENT_DIR);
|
||||||
|
cp(FIREFOX_CONTENT_DIR + 'PdfRedirector.jsm', MOZCENTRAL_CONTENT_DIR);
|
||||||
|
|
||||||
// Copy extension files
|
// Copy extension files
|
||||||
cd('extensions/firefox');
|
cd('extensions/firefox');
|
||||||
@ -645,11 +651,11 @@ target.mozcentral = function() {
|
|||||||
MOZCENTRAL_EXTENSION_DIR + 'README.mozilla');
|
MOZCENTRAL_EXTENSION_DIR + 'README.mozilla');
|
||||||
|
|
||||||
sed('-i', /PDFJSSCRIPT_STREAM_CONVERTER_ID/, MOZCENTRAL_STREAM_CONVERTER_ID,
|
sed('-i', /PDFJSSCRIPT_STREAM_CONVERTER_ID/, MOZCENTRAL_STREAM_CONVERTER_ID,
|
||||||
MOZCENTRAL_EXTENSION_DIR + 'components/PdfStreamConverter.js');
|
MOZCENTRAL_CONTENT_DIR + 'PdfStreamConverter.jsm');
|
||||||
sed('-i', /PDFJSSCRIPT_PREF_PREFIX/, MOZCENTRAL_PREF_PREFIX,
|
sed('-i', /PDFJSSCRIPT_PREF_PREFIX/, MOZCENTRAL_PREF_PREFIX,
|
||||||
MOZCENTRAL_EXTENSION_DIR + 'components/PdfStreamConverter.js');
|
MOZCENTRAL_CONTENT_DIR + 'PdfStreamConverter.jsm');
|
||||||
sed('-i', /PDFJSSCRIPT_MOZ_CENTRAL/, 'true',
|
sed('-i', /PDFJSSCRIPT_MOZ_CENTRAL/, 'true',
|
||||||
MOZCENTRAL_EXTENSION_DIR + 'components/PdfStreamConverter.js');
|
MOZCENTRAL_CONTENT_DIR + 'PdfStreamConverter.jsm');
|
||||||
|
|
||||||
// Copy test files
|
// Copy test files
|
||||||
mkdir('-p', MOZCENTRAL_TEST_DIR);
|
mkdir('-p', MOZCENTRAL_TEST_DIR);
|
||||||
|
Loading…
Reference in New Issue
Block a user