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