i can't see more my global object created by Components.utils.import("resource://gre/modules/myfile.jsm") in firefox 17 -
i have used next code create myglobalobject in multiwindows application in firefox 15- .
netscape.security.privilegemanager.enableprivilege("universalxpconnect"); components.utils.import("resource://gre/modules/myglobalobject.jsm");
my file myglobalobject.jsm simple:
var exported_symbols = [ "myglobalobject" ]; if ("undefined" == typeof(myglobalobject)) { var myglobalobject = {}; myglobalobject[0]=1; }
since firefox 17+ code doesn't operate. have created add-on next main.js:
exports.main = function() { var { cu } = require("chrome"); cu.import("resource://gre/modules/myglobalobject.jsm"); };
nevertheless can't access myglobalobject in javascript-code inside of application. in misunderstanding programming firefox 17+ consists?
when creating add-ons add-on sdk, cu.import()
won't recognize scope of package correctly. means have assign exported symbols explicitly:
var {cu} = require("chrome"); var {myglobalobject} = cu.import("resource://gre/modules/myglobalobject.jsm", null);
Comments
Post a Comment