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