puppeteer-firefox 开启扩展
puppeteer-firefox安装扩展
puppeteer-firefox 目前已经有许多人在投入开发工作,但是和chrome的launch打开扩展api不一致,在chrome中,我们可以很容易配置参数就可以打开插件,但是在firefox中我们要使用web-ext 去启动firefox并且使用connect去连接。
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扩展开启方式
puppeteer-firefox 开启扩展的更多相关文章
- firefox 开启安全禁用端口
firefox 开启安全禁用端口 step1: 在firefox地址栏键入 about:config step2: 新建字符串 network.security.ports.banned.overri ...
- firefox常用扩展、脚本
1.AutoPopup.uc.js:鼠标移到菜单和下拉箭头上自动弹出下拉菜单 2.moveButton.uc.js:移动或克隆按钮或菜单到火狐浏览器的任意位置 moveButton.uc.js使用说明 ...
- firefox必备扩展
1.首先,当然要推荐 Adblock Plus 安装地址:https://adblockplus.org/zh_CN/firefox 作用:屏蔽广告,从此和该死的广告说拜拜吧(不论是百度推广,还是别的 ...
- 旧版本firefox添加扩展addons的地址
不要在 firefox 本身的addons 中去查找, 搜索, 那个是搜索不到的, 因为那个是针对 最新版的, 旧版本的很多插件都不能用, 被移除了, 要在 那个专门 提供 插件的站点中去寻找扩展 h ...
- php连接oracle oracle开启扩展
<?php /** * 由于公司的需要,使用php+oracle开发项目,oracle因为有专门人员开发设计,我们只需远程调用 *于是乎遇到了蛋疼的问题就是开启oracle扩展的问题,虽然你在p ...
- php以pdo方式连接sqlserver,无法开启sqlsrv扩展
首先,PHP连接sqlserver代码如下: $host="aaaaa"; $dbname="aaaaa"; $user="aaaaa"; ...
- win10 64位安装memcache扩展和开启redis扩展
前面有关于win10下搭建wamp环境的介绍,在此不在赘述,php操作memcache有memcache库和memcached库,其中memcache是php内置的扩展库,支持面向对象和面向过程两种操 ...
- php开启mysqli扩展之后如何连接数据库
Mysqli是php5之后才有的功能,没有开启扩展的朋友可以打开您的php.ini的配置文件;相对于mysql有很多新的特性和优势,需要了解的朋友可以参考下 Mysqli是php5之后才有的功能,没有 ...
- Firefox扩展开发
Firefox扩展开发 (插件开发) Extension开发 入门教程 5步走 五步走 首先需要知道什么是"Firefox插件".这里说的"插件"只是一个通 ...
随机推荐
- __property 关键字的使用
https://blog.csdn.net/lixingshi/article/details/41277577 __property是属性关键字,用来定义类的某种属性. 给类定义属性,是BCB的扩展 ...
- saltstack 发布 iis 站点
Saltstack 发布 iis 站点 saltstack 主服务器配置:切换到 salt 的主目录下 : 主目录示例:/home/salt 程序集放置目录: web/web1 sls 目录: web ...
- 代码格式化工具---indent工具
indent工具,可以把代码格式化成某种风格. 通过命令:rpm -qa | grep indent 查看是否安装了indent工具. 若没有,可使用命令sudo apt-get install ...
- [WARNING] 找不到编译器:wepy-compiler-less。 [Error] 未发现相关 less 编译器配置,请检查wepy.config.js文件。
npm install less 之后 npm install wepy-compiler-less 解决 请点赞!因为你的鼓励是我写作的最大动力! 吹逼交流群:711613774
- Java中的读文件,文件的创建,写文件
前言 大家好,我是 Vic,今天给大家带来Java中的读文件,文件的创建,写文件的概述,希望你们喜欢 示意图 读文件 public static void read(String path,Strin ...
- AtCoder Beginner Contest 133 E - Virus Tree 2(组合数学)
题意 n个点的树k种颜色,距离不超过2的点对需颜色不同,求方案数 Code(copy) #include<iostream> #include<cstdio> #include ...
- Redis恢复数据
对于单点或者集群,都可以用 cat data.txt | redis-cli --pipe方式进行冷恢复. 对于大数据量会很慢,但不会出错.
- certification on windows and
https://jingyan.baidu.com/article/335530dae0eb2319ca41c378.html
- Go -- client 302 自动转 200 问题 cookie存储 模拟登陆问题
不久前用go写了个http client,去模拟某网站(*.com)的登录操作.网站的登录逻辑:1.验证登录账号和密码:2.下发token.此token通过cookie下发:3.redirect到主页 ...
- Word 软回车和硬回车
网页上复制一大段内容,会发现很多向下的箭头,这种叫软回车,要如何批量替换成常见的硬回车呢? 工具/原料 word文档 方法/步骤 1 先认识这种向下的箭头,这种回车形式叫软回车,按shif ...