diff --git a/src/editor/index.js b/src/editor/index.js index 44e85ad3..c511058b 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -36,7 +36,10 @@ svgEditor.setConfig( svgEditor.setConfig({ extensions: [], noDefaultExtensions: false, - userExtensions: [] + // in addition to standard extensions, it is possible to add user extensions. + // they behave exactly like all extensions but they can be anywhere + // so the full relative path needs to specified for each user extensions. + userExtensions: [/* '../ext-helloworld/ext-helloworld.js' */] }); // OTHER CONFIG diff --git a/src/editor/svgedit.js b/src/editor/svgedit.js index c3c0762a..a6821433 100644 --- a/src/editor/svgedit.js +++ b/src/editor/svgedit.js @@ -277,6 +277,7 @@ let svgCanvas, urldata = {}, // We do not put on defaultConfig to simplify object copying // procedures (we obtain instead from defaultExtensions) extensions: [], + userExtensions: [], /** * Can use `location.origin` to indicate the current * origin. Can contain a '*' to allow all domains or 'null' (as @@ -469,7 +470,7 @@ editor.setConfig = function (opts, cfgCfg) { } else { editor.pref(key, val); } - } else if (['extensions', 'allowedOrigins'].includes(key)) { + } else if (['extensions', 'userExtensions', 'allowedOrigins'].includes(key)) { if (cfgCfg.overwrite === false && ( curConfig.preventAllURLConfig || @@ -4387,7 +4388,7 @@ editor.init = function () { * @returns {void} */ const clickImport = function () { - /* */ + /* empty fn */ }; /**