有什么方法可以在Google Chrome扩展程序中获取命令行参数? [英] Is there any way to get command line parameters in Google Chrome extension?

查看:52
本文介绍了有什么方法可以在Google Chrome扩展程序中获取命令行参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用自定义参数从命令行启动Chrome包含一些js文件的路径.此外,此路径将用于扩展名.

I need to launch Chrome from command line with custom parameter, which contains path to some js-file. Further this path will be used in extension.

我仔细浏览了所有相关文档,并单击了其中的所有节点.Chrome调试器,但找不到与命令行类似的内容参数.是否有可能获得这些参数还是需要写更复杂的npapi扩展?(从理论上讲,在这种npapi-扩展,我们能够通过win-api,命令行的自我过程等).

I browsed carefully all related documentation and clicked all nodes in Chrome debugger, but found nothing which can resemble on command line parameters. Is it possible anyway to get these parameters or it's need to write more complex npapi-extension? (theoretically in such npapi- extension we able to get self process through win-api, command line of self process and so on).

推荐答案

提示警报:

Hack alert: this post suggests passing a fake URL to open that has all the command-line parameters as query string parameters, e.g.,

chrome.exe http://fakeurl.com/?param1=val1&param2=val2

这篇关于有什么方法可以在Google Chrome扩展程序中获取命令行参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆