Closed Bug 640700 Opened 11 years ago Closed 11 years ago

Set gAppData in content process

Categories

(Core :: XPCOM, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jdm, Unassigned)

Details

Attachments

(1 file)

>  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?
I don't think so, why does the content process need to know this info?
Attached file testcase
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.
WONTFIX it is.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
(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.
You need to return sendSyncMessage('SPappinfo', {})[0];  Also the msg var is not used.
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.
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.