@@ -1,10 +1,10 @@ // IBDAWG /* jshint esversion:6, -W097 */ /* jslint esversion:6 */ -/* global require, exports, console*/ +/* global require, exports, console, __dirname */ "use strict"; if(typeof process !== 'undefined') { var str_transform = require('./str_transform.js'); @@ -99,11 +99,16 @@ constructor (param1, sPath="") { // param1 can be a filename or a object with all the necessary data. try { let oData = null; if (typeof(param1) == "string") { - let sURL = (sPath !== "") ? sPath + "/" + param1 : "resource://grammalecte/graphspell/_dictionaries/"+param1; + let sURL; + if(typeof process !== 'undefined') { + sURL = (sPath !== "") ? sPath + "/" + param1 : __dirname + "/_dictionaries/"+param1; + } else { + sURL = (sPath !== "") ? sPath + "/" + param1 : "resource://grammalecte/graphspell/_dictionaries/"+param1; + } oData = JSON.parse(helpers.loadFile(sURL)); } else { oData = param1; } Object.assign(this, oData);