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

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -