mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Mobile: Plugins: Fix incorrect Node exports emulation (#10776)
This commit is contained in:
parent
afcd2d2a39
commit
331f7ebe5c
@ -59,8 +59,8 @@ const useContentScripts = (pluginStates: PluginStates) => {
|
||||
if (event.cancelled) return;
|
||||
|
||||
const contentScriptModule = `(function () {
|
||||
const module = { exports: null };
|
||||
const exports = {};
|
||||
const module = { exports: exports };
|
||||
|
||||
${content}
|
||||
|
||||
|
@ -82,7 +82,7 @@ export default class PluginLoader {
|
||||
scriptElement.appendChild(document.createTextNode(`
|
||||
(async () => {
|
||||
const exports = {};
|
||||
const module = {};
|
||||
const module = { exports: exports };
|
||||
const require = window.__pluginLoaderRequireFunctions[${JSON.stringify(this.pluginLoaderId)}];
|
||||
const joplin = {
|
||||
require,
|
||||
@ -90,7 +90,7 @@ export default class PluginLoader {
|
||||
|
||||
${js};
|
||||
|
||||
window.__pluginLoaderScriptLoadCallbacks[${JSON.stringify(scriptId)}](module.exports || exports);
|
||||
window.__pluginLoaderScriptLoadCallbacks[${JSON.stringify(scriptId)}](module.exports);
|
||||
})();
|
||||
`));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user