diff --git a/extensions/firefox/content/PdfJsDefaultPreferences.jsm b/extensions/firefox/content/PdfJsDefaultPreferences.sys.mjs similarity index 85% rename from extensions/firefox/content/PdfJsDefaultPreferences.jsm rename to extensions/firefox/content/PdfJsDefaultPreferences.sys.mjs index cc4b7b043..738adad80 100644 --- a/extensions/firefox/content/PdfJsDefaultPreferences.jsm +++ b/extensions/firefox/content/PdfJsDefaultPreferences.sys.mjs @@ -13,10 +13,6 @@ * limitations under the License. */ -"use strict"; - -var EXPORTED_SYMBOLS = ["PdfJsDefaultPreferences"]; - -var PdfJsDefaultPreferences = Object.freeze( +export const PdfJsDefaultPreferences = Object.freeze( PDFJSDev.eval("DEFAULT_PREFERENCES") ); diff --git a/gulpfile.js b/gulpfile.js index 11894222f..1d32fdea8 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -434,12 +434,15 @@ function createSandboxExternal(defines) { saveComments: false, defines, }; - return gulp.src("./src/pdf.sandbox.external.js").pipe( - transform("utf8", content => { - content = preprocessor2.preprocessPDFJSCode(ctx, content); - return `${licenseHeader}\n${content}`; - }) - ); + return gulp + .src("./src/pdf.sandbox.external.js") + .pipe(rename("pdf.sandbox.external.sys.mjs")) + .pipe( + transform("utf8", content => { + content = preprocessor2.preprocessPDFJSCode(ctx, content); + return `${licenseHeader}\n${content}`; + }) + ); } function createTemporaryScriptingBundle(defines, extraOptions = undefined) { @@ -1381,7 +1384,7 @@ gulp.task( .pipe(gulp.dest(MOZCENTRAL_L10N_DIR)), gulp.src("LICENSE").pipe(gulp.dest(MOZCENTRAL_EXTENSION_DIR)), gulp - .src(FIREFOX_CONTENT_DIR + "PdfJsDefaultPreferences.jsm") + .src(FIREFOX_CONTENT_DIR + "PdfJsDefaultPreferences.sys.mjs") .pipe(transform("utf8", preprocessDefaultPreferences)) .pipe(gulp.dest(MOZCENTRAL_CONTENT_DIR)), ]); diff --git a/src/pdf.sandbox.external.js b/src/pdf.sandbox.external.js index 68bb48a2d..ce77db1c6 100644 --- a/src/pdf.sandbox.external.js +++ b/src/pdf.sandbox.external.js @@ -16,7 +16,7 @@ // In mozilla-central, this file is loaded as non-module script, // so it mustn't have any dependencies. -class SandboxSupportBase { +export class SandboxSupportBase { /** * @param {DOMWindow} - win */ @@ -181,10 +181,3 @@ class SandboxSupportBase { }; } } - -if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) { - exports.SandboxSupportBase = SandboxSupportBase; -} else { - /* eslint-disable-next-line no-unused-vars, no-var */ - var EXPORTED_SYMBOLS = ["SandboxSupportBase"]; -}