Then change the devDependencies in package.json by replacing all ^ with empty string. The reason is that ^ will use the newest version of dependency, whose interfaces have changed. Especially, zotero-types has many differences between 1.0.13 and 1.3.20. Then build the extension.
npm install
npm run build
Then install this extension in zotero and restart the zotero. After that, disable and then re-enable the extension to make the settings of the extension available in the preference menu of zotero. Use the following settings.
Then select a word in English and there is no popup. See the following image.
Is there an existing issue for this?
Have you checked the FAQ (https://github.com/windingwind/zotero-pdf-translate/issues/6)?
Are you using the latest Zotero and the latest plugin?
Environment
Describe the bug
The released extension at github release can popup the translation but the generated version can not.
steps to reproduce the bug.
Then change the
devDependencies
inpackage.json
by replacing all^
with empty string. The reason is that^
will use the newest version of dependency, whose interfaces have changed. Especially,zotero-types
has many differences between1.0.13
and1.3.20
. Then build the extension.Then install this extension in zotero and restart the zotero. After that, disable and then re-enable the extension to make the settings of the extension available in the preference menu of zotero. Use the following settings.
Then select a word in English and there is no popup. See the following image.
Debug Output
[JavaScript Error: "WeakRef is not defined" {file: "resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js" line: 7242}] createElement@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:7242:17 addStyle@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:9857:25 initializeUI@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:9402:11 node_modules/zotero-plugin-toolkit/dist/managers/prompt.js/Prompt<@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:9396:11 node_modules/zotero-plugin-toolkit/dist/managers/prompt.js/PromptManager2<@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:10027:36 ZToolkit<@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:14182:21 Addon<@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:14150:19 @resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:14209:25 @resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:2:1 startup@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js:94:3
Anything else?
No response