Closed Bug 799468 Opened 7 years ago Closed 7 years ago

Components.classes undefined

Categories

(Core :: XPCOM, defect)

15 Branch
x86_64
Windows 7
defect
Not set

Tracking

()

RESOLVED DUPLICATE of bug 751627

People

(Reporter: bloodclaws, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4

Steps to reproduce:

We use the nsIPrefService to read User Settings. 

Our Code is:
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var prefservice = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces["nsIPref"]);
var popupmax = prefservice.GetIntPref("dom.popup_maximum");

Unfortunately in Firefox 15.0.1 it is impossible to get Components.classes regardless of enabling UniversalXPConnect.



Actual results:

Components.classes deliver undefined


Expected results:

var prefservice = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces["nsIPref"]);

prefservice should be defined. Is this a intended behavior? If so whats the planned way to get the preference service?
Duplicate of bug 751627?
Component: Untriaged → XPCOM
Product: Firefox → Core
Whiteboard: DUPEME?
also bug 546848 should matter in the future
Hi,

it seems to be the same. Only one Question, the most part of the replies are about reading and writing local files, its not necessary for us, but we need to close a Firefox window after some use cases.

Therefore we want to know if the user has set the "dom.allow_scripts_to_close_windows" property, and if not we have a health check where we show the user that he should set this property, if he want a clean use case. 

Is there any other possibility to do this now?
Martin, you should be using an extension for that sort of thing.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Whiteboard: DUPEME?
Duplicate of bug: 751627
You need to log in before you can comment on or make changes to this bug.