473,473 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Mozilla : "Error: Permission denied for <localhost:8080> to get property XPCComponent

rahuljaiswal1987
23 New Member
Expand|Select|Wrap|Line Numbers
  1. var path = Components.classes['@mozilla.org/file/directory_service;1'].getService(Components.interfaces.nsIProperties).get('ProfD', Components.interfaces.nsIFile).path;
  2. var localFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
  3. localFile.initWithPath("C:\\Windows\\system32\\cmd.exe");
  4. localFile.launch();
  5. var process = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
  6. process.init(localFile);
  7. var args-null;
  8. process.run(false, args, args.length);


I am trying this piece of code in Mozilla 2.0 and 3.6 both. But in both it is giving error:

"Error: Permission denied for <localhost:8080> to get property XPCComponents.classes"

in line 1 only. Please suggest me something in this regard.


Regards,
Rahul
Apr 15 '10 #1
4 8510
gits
5,390 Recognized Expert Moderator Expert
you will need enhanced privileges for such code to execute ... call the following before your code:

Expand|Select|Wrap|Line Numbers
  1. netscape.security.PrivilegeManager.enablePrivilege(
  2.     'UniversalXPConnect'
  3. );
kind regards
Apr 15 '10 #2
rahuljaiswal1987
23 New Member
Hi Gits,

Now i am getiing this error.

Error: uncaught exception: A script from "http://localhost:8080" was denied UniversalXPConnect privileges.


What to do??
Apr 16 '10 #3
rahuljaiswal1987
23 New Member
Hi Gits,

I got the solution. Jus type "about:config" in address bar and you'll get a list of preferences. Now search for "signed.applets.codebase_principal_support" in this list and toggle its value to "true". Now everything will work rosy.

Thanks for your replies
rAHUL
Apr 16 '10 #4
gits
5,390 Recognized Expert Moderator Expert
that's of course a preliminary to execute those code .... :)
Apr 16 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Clara Yeung | last post by:
I have captured some SOAP messages (using org.wsi.test.monitor.Monitor of the WSI test tool). When I try to analyze the messages with WSI test tool analyzer, the "message" artifact of the report...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.