If you want JS code to load into a context with something predefined, you probably want to be using a sandbox and a subscript loader, not JSM's.
For an example, check out this code that uses Thunderbird's fake-server code that used to run in an xpcshell context but instead run it in a sandbox (see makeSandbox/loadInSandbox): https://github.com/mozilla-b2g/mail-fakeservers/blob/master/xpcom/fake-server-support.js#L81 (Note that if the code does Cu.import, you'd pass "false" for wantComponents.) Andrew _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform