javascript-从油腻的monkey启动本地可执行文件
作者:互联网
下面是我正在尝试的代码(加上一些变体),有一个对话框询问我的许可,但仍然出现错误
Error: Permission denied for to get property XPCComponents.classes
unsafeWindow.netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var file = unsafeWindow.Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
file.initWithPath("d:\\test.bat");
var process = unsafeWindow.Components.classes["@mozilla.org/process/util;1"]
.createInstance(Components.interfaces.nsIProcess);
process.init(file);
var args = ["argument1", "argument2"];
process.run(false, args, args.length);
这只是不可能吗?
解决方法:
你不能参见Do Greasemonkey scripts have chrome privileges?.
标签:local-files,greasemonkey,javascript 来源: https://codeday.me/bug/20191102/1993388.html