Closed
Bug 640700
Opened 14 years ago
Closed 14 years ago
Set gAppData in content process
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: jdm, Unassigned)
Details
Attachments
(1 file)
|
377 bytes,
text/html
|
Details |
> var appinfo = Components.classes["@mozilla.org/xre/app-info;1"]
> .getService(Components.interfaces.nsIXULAppInfo);
> if (appinfo.ID == "{a23983c0-fd0e-11dc-95ff-0800200c9a66}") {
This currently doesn't work in a content process (think Mochitest here). Benjamin, is this something we want to work?
Comment 1•14 years ago
|
||
I don't think so, why does the content process need to know this info?
Comment 2•14 years ago
|
||
Comment 3•14 years ago
|
||
Just FYI, we're going to kill enablePrivilege in the near future anyway. Anything that you want to do in Mochitests that requires privileges should go through the SpecialPowers framework.
| Reporter | ||
Comment 4•14 years ago
|
||
WONTFIX it is.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
Comment 5•14 years ago
|
||
(In reply to comment #3)
> Just FYI, we're going to kill enablePrivilege in the near future anyway.
> Anything that you want to do in Mochitests that requires privileges should go
> through the SpecialPowers framework.
How does that work then?
I tried adding this:
In SpecialPowersObserver.js:
case "SPappinfo":
return "string";
break;
In specialpowers.js:
getAppID: function() {
var msg = {'op':'get', 'prefName': 'browser.tabs.remote','prefType': 'BOOL'};
return sendSyncMessage('SPappinfo', msg);
},
I keep getting nothing returned.
| Reporter | ||
Comment 6•14 years ago
|
||
You need to return sendSyncMessage('SPappinfo', {})[0]; Also the msg var is not used.
Comment 7•14 years ago
|
||
I know that the msg var is not used. I'm just trying to get something that is working.
Anyway, I tried your "sendSyncMessage('SPappinfo', {})[0];" suggestion. It doesn't work. When I call "alert(SpecialPowers.getAppID());", I get 'undefined' returned.
Comment 8•14 years ago
|
||
It turned out, I had to add " messageManager.addMessageListener("SPappinfo", this);" in SpecialPowersObserver.js observe function.
You need to log in
before you can comment on or make changes to this bug.
Description
•