liuxb
非常火狐
非常火狐
  • UID26160
  • 注册日期2008-09-05
  • 最后登录2021-12-02
  • 发帖数659
  • 经验324枚
  • 威望0点
  • 贡献值184点
  • 好评度16点
阅读:943回复:1

求助一个js问题

楼主#
更多 发布于:2017-04-07 18:11
有个脚本里面的一句
this.shellServicr.openApplicationWithURI(this.browser,aURI.spec);
把当前url,http://xxx,传递给前面程序
我现在想让程序接受到的url是加上双引号的,"http://xxx",然后写成
this.shellServicr.openApplicationWithURI(this.browser,' " '+aURI.spec+' " ');
结果程序收到的的是 \"https://xxx\",多了两个反斜杠。
请问下那个地方怎么写?
谢谢。
shellServicr是这么定义的:
shellServicr:Cc["@mozilla.org/browser/shell-service;1"].getService(Ci.nsIShellService),
我的...
liuxb
非常火狐
非常火狐
  • UID26160
  • 注册日期2008-09-05
  • 最后登录2021-12-02
  • 发帖数659
  • 经验324枚
  • 威望0点
  • 贡献值184点
  • 好评度16点
1楼#
发布于:2017-04-07 21:47
app:"C:\\xxx",
file:Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile),
process:Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess),
file.initWithPath(app);
process.init(file);
var args = [gBrowser.currentURI.spec];
process.run(false, args, args.length);
怎么才能让最后传递到app的url是加了双引号的 "http://xxx" 而不是 http://xxx 这种的啊?
我的...
游客

返回顶部