puppeteer-firefox安装扩展

puppeteer-firefox 目前已经有许多人在投入开发工作,但是和chrome的launch打开扩展api不一致,在chrome中,我们可以很容易配置参数就可以打开插件,但是在firefox中我们要使用web-ext 去启动firefox并且使用connect去连接。

官方issue

Current tip-of-tree status of Puppeteer-Firefox is availabe at isPuppeteerFirefoxReady?

Add-ons

Firefox Add-ons differs from Chrome extensions, hence precess of its install is different.

Firefox Add-on can be installed using web-ext library which runs Firefox binary and can be connected using Puppeteer connect API.

const webExt = require('web-ext').default;
const pptrFirefox = require('puppeteer-firefox');
const getPort = require('get-port');
(async () => {
const CDPPort = await getPort();
await webExt.cmd.run(
{
sourceDir: 'path-to-add-on',
firefox: pptrFirefox.executablePath(),
args: [`-juggler=${CDPPort}`]
},
{
// These are non CLI related options for each function.
// You need to specify this one so that your NodeJS application
// can continue running after web-ext is finished.
shouldExitProgram: false
}
);
const browser = await pptrFirefox.connect({
browserWSEndpoint: `ws://127.0.0.1:${CDPPort}`
});
})();

package.json example

{
"dependencies": {
...
"get-port": "^4.2.0",
"web-ext": "^3.1.0",
"puppeteer-firefox": "^0.5.0"
...
},
}

chrome扩展开启方式

chrome extensions

博客: https://github.com/zhaojunlike

puppeteer-firefox 开启扩展的更多相关文章

  1. firefox 开启安全禁用端口

    firefox 开启安全禁用端口 step1: 在firefox地址栏键入 about:config step2: 新建字符串 network.security.ports.banned.overri ...

  2. firefox常用扩展、脚本

    1.AutoPopup.uc.js:鼠标移到菜单和下拉箭头上自动弹出下拉菜单 2.moveButton.uc.js:移动或克隆按钮或菜单到火狐浏览器的任意位置 moveButton.uc.js使用说明 ...

  3. firefox必备扩展

    1.首先,当然要推荐 Adblock Plus 安装地址:https://adblockplus.org/zh_CN/firefox 作用:屏蔽广告,从此和该死的广告说拜拜吧(不论是百度推广,还是别的 ...

  4. 旧版本firefox添加扩展addons的地址

    不要在 firefox 本身的addons 中去查找, 搜索, 那个是搜索不到的, 因为那个是针对 最新版的, 旧版本的很多插件都不能用, 被移除了, 要在 那个专门 提供 插件的站点中去寻找扩展 h ...

  5. php连接oracle oracle开启扩展

    <?php /** * 由于公司的需要,使用php+oracle开发项目,oracle因为有专门人员开发设计,我们只需远程调用 *于是乎遇到了蛋疼的问题就是开启oracle扩展的问题,虽然你在p ...

  6. php以pdo方式连接sqlserver,无法开启sqlsrv扩展

    首先,PHP连接sqlserver代码如下: $host="aaaaa"; $dbname="aaaaa"; $user="aaaaa"; ...

  7. win10 64位安装memcache扩展和开启redis扩展

    前面有关于win10下搭建wamp环境的介绍,在此不在赘述,php操作memcache有memcache库和memcached库,其中memcache是php内置的扩展库,支持面向对象和面向过程两种操 ...

  8. php开启mysqli扩展之后如何连接数据库

    Mysqli是php5之后才有的功能,没有开启扩展的朋友可以打开您的php.ini的配置文件;相对于mysql有很多新的特性和优势,需要了解的朋友可以参考下 Mysqli是php5之后才有的功能,没有 ...

  9. Firefox扩展开发

    Firefox扩展开发 (插件开发) Extension开发 入门教程 5步走 五步走   首先需要知道什么是"Firefox插件".这里说的"插件"只是一个通 ...

随机推荐

  1. make 的使用参数

  2. copy()函数技术推演

    /*** str_copy.c ***/ #include<stdio.h> void copy_str21(char *from, char *to) { for(; *from != ...

  3. video标签在浏览器不能使用的问题 ?

    之前video标签是可以用的,但是压缩之后在移动端可以用,在pc浏览器不可以用? 怎么解决? 这样的写法会报错  说是缺乏source  但是你加上source也没有用 <video src=& ...

  4. Percona,MariaDB,MySQL衍生版如何取舍

    缘起 自从甲骨文公司收购了MySQL后,有将MySQL闭源的潜在风险.而且Oracle对培养MySQL这个免费的儿子并不太用心,漏洞修补和版本升级的速度一段时间非常缓慢,所以业界对MySQL的未来普遍 ...

  5. Spring boot 去除URL 里的 JSESSIONID

    方法一 application.yml 里设置 server: port: 80 servlet: session: tracking-modes: cookie cookie: http-only: ...

  6. Android Mboot mmc命令介绍

    mmc command.         目前Mboot支持以下mmc命令: 1) mmc read/write.    读写命令.Addr = 内存地址, blk# = 起始block数, size ...

  7. android studio: 对齐成员变量及链式方法

    "File"-"Settings"-"Editor"-"Java"-"Wrapping and Braces& ...

  8. SpringMVC:HandlerInterceptor log 日志

    springMVC:HandlerInterceptor拦截器添加系统日志(权限校验)代码收藏 - LinkcOne - CSDN博客https://blog.csdn.net/qq_22815337 ...

  9. Windows环境下最新OpenCV和Contribute代码的联合编译【20190505更新红字】

    解决这个问题,目的在于获得并使用最新的完全版本的代码,主要方法是对CMake能够熟练使用,并且对编译等基础支持有所了解. 因为这篇博客经过多次修改,所以里面的内容和配图可能有不是完全比对的地方,但是只 ...

  10. lintcode 394. Coins in a Line 、leetcode 292. Nim Game 、lintcode 395. Coins in a Line II

    变型:如果是最后拿走所有石子那个人输,则f[0] = true 394. Coins in a Line dp[n]表示n个石子,先手的人,是必胜还是必输.拿1个石子,2个石子之后都是必胜,则当前必败 ...