使用命令提示符运行Chrome扩展程序 [英] Run Chrome Extensions using command prompt

查看:199
本文介绍了使用命令提示符运行Chrome扩展程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从命令行运行chrome扩展程序? 我需要使我的软件过程自动化,并且我的软件将需要使用特定参数来运行该扩展.

Is it possible to run a chrome extension from command line? I need to automate the process for my software, and my software will need to run that extension with a particular parameter.

我正在使用Yogi的Chrome扩展程序"APK下载器".扩展程序是这样的: 如果页面包含任何 .apk 文件链接,那么当我点击地址栏上扩展名的图标时,它将开始直接下载该 .apk 文件"

I am using a Chrome Extension 'APK Downloader' by Yogi. The Extension works like this:- "If a page contains any .apk file link, then when I click on the extension's icon on the address bar, it starts direct download of that .apk file"

现在,我的软件需要下载一些 .apk 文件[该软件将具有要下载的 .apk 文件的软件包名称,即由扩展程序使用以生成下载链接].这将是一个自动过程.因此,我需要知道是否可以将参数自动传递给扩展名,并使扩展名能够在不单击扩展名的情况下正常工作.

Now, I have my software that needs some .apk file to download [The software will have the package name of the .apk file to be downloaded, which is used by the extension to generate a download link]. It will be an automatic process. So, I need to know if it is possible to pass a parameter to the extension automatically, and make the extension to work without clicking on it.

有可能这样做吗?

推荐答案

可以使用--load-extension=标志加载解压缩的扩展名.

Unpacked extension can be loaded using the --load-extension= flag.

我通常要做的是chromium --user-data-dir=/tmp/someuniquedirname --load-extension=path/to/extension --no-first-run.

  • --user-data-dir=标志用于指定非默认的用户数据目录,以最大程度地减少现有浏览器配置文件和测试目录之间的冲突.如果要使用默认用户配置文件,则可以省略此标志.
  • --no-first-run标志可防止显示首次运行的用户界面(例如,说明如何使用多功能框的气泡,以及在新标签页中打开的入门"页面).
  • The --user-data-dir= flag is used to specify a non-default user data directory, to minimize conflicts between your existing browser profile and the test directory. You can omit this flag if you want to use your default user profile.
  • The --no-first-runflag prevents the first run UI from showing up (e.g. the bubble that explains how to use the omnibox, and a "Getting Started" page that opens in a new tab).

您可以通过用逗号分隔路径来加载多个扩展名,例如chromium --load-extension=path/to/one/extension,path/to/another/extension.

You can load multiple extensions by separating the paths by commas, e.g. chromium --load-extension=path/to/one/extension,path/to/another/extension.

我已经发布了一些Shell脚本和一个便捷扩展,以加快(手动)测试Chrome扩展.看看 https://github.com/Rob- -W/extension-dev-tools/tree/master/chrome .

I have published some shell scripts and a convenience extension to speed up (manual) testing of Chrome extensions. Take a look at https://github.com/Rob--W/extension-dev-tools/tree/master/chrome.

这篇关于使用命令提示符运行Chrome扩展程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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