1
var localFile = Components.classes["@mozilla.org/filelocal;1"].createInstance(Components.interfaces.nsILocalFile);
localFile.initWithPath("C:\Windows\system32\cmd.exe");
var process = Components.classes["@mozilla.org/processutil;1"].createInstance(Components.interfaces.nsIProcess);
process.init(localFile);
var args=null;
process.run(false, args, args.length);
我使用Firefox/3.6。上面的代码没有被调用。我想,有没有必要在我的代码中包含一些东西来调用这些组件。在我的浏览器中,这些XPComponent可用,因为我使用**检查**是否有任何需要在我的代码中包含某些内容来调用这些组件?
XPComViewer。
Plzzz尽快回复。
问候,拉胡尔......
我不喜欢这只但我得到以下错误:
错误:权限拒绝http://localhost:8080来获得属性XPCComponents.classes源文件:本地主机:8080/ViewerSoln线:60
我想这在火狐2.0和3.6都。它的Windows环境。请尽快给我一些建议。
谢谢, Rahul。
我不喜欢这只但我得到以下错误: 错误:权限拒绝来获得属性XPCComponents.classes 源文件:http://本地主机:8080/ViewerSoln/ Line:60 我试着在Firefox 2.0和3.6上都这样做。它的Windows环境。请尽快给我一些建议。 谢谢, Rahul。 –
Rahul
2010-04-15 11:26:21
@Rahul:你无法做任何需要来自内容页面的扩展特权。您应该使用的具体解决方案取决于您的具体情况。请搜索以前的讨论。例如。 http://stackoverflow.com/questions/127693/firefox-xpcom-component-permission-denied-to-call-method-unnamedclass/146820#146820 – Nickolay 2010-04-15 13:54:17