1
0
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:
Henry Heino 2024-07-23 12:10:59 -07:00 committed by GitHub
parent afcd2d2a39
commit 331f7ebe5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -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}

View File

@ -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);
})();
`));