ESMify EPUB and uses

This commit is contained in:
Abe Jellinek 2025-07-01 14:09:17 -04:00
parent 937ad309a7
commit 6f96fa9da8
3 changed files with 3 additions and 5 deletions

View file

@ -23,8 +23,6 @@
***** END LICENSE BLOCK *****
*/
var EXPORTED_SYMBOLS = ["EPUB"];
ChromeUtils.defineESModuleGetters(this, {
Zotero: "chrome://zotero/content/zotero.mjs",
});
@ -38,7 +36,7 @@ const ZipReader = Components.Constructor(
const DC_NS = 'http://purl.org/dc/elements/1.1/';
const OPF_NS = 'http://www.idpf.org/2007/opf';
class EPUB {
export class EPUB {
_zipReader;
_contentOPF = null;

View file

@ -411,7 +411,7 @@ Zotero.Fulltext = Zotero.FullText = new function () {
* @return {Promise}
*/
this.indexEPUB = async function (filePath, itemID, allText) {
const { EPUB } = ChromeUtils.import('chrome://zotero/content/EPUB.jsm');
const { EPUB } = ChromeUtils.importESModule("chrome://zotero/content/EPUB.mjs");
let maxLength = Zotero.Prefs.get('fulltext.textMaxLength');
if (maxLength === 0) {

View file

@ -578,7 +578,7 @@ Zotero.RecognizeDocument = new function () {
}
async function _recognizeEPUB(item, filePath) {
const { EPUB } = ChromeUtils.import('chrome://zotero/content/EPUB.jsm');
const { EPUB } = ChromeUtils.importESModule("chrome://zotero/content/EPUB.mjs");
let epub = new EPUB(filePath);
try {