
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
matman-crawler
Advanced tools
matman 端对端测试方案中使用到的前端爬虫处理工具,更多资料请参考: matman 官方文档 。
$ npm install matman-crawler --save
nightmare 提供了 custom preload script 的能力,支持注入一个单文件脚本(我们称之为前端爬虫脚本)。
但是它有两个限制:
而实际情况时,我们更倾向于使用 CommonJS 规范来组织项目,自然会存在多个组件和多个文件的情况。因此,基于 webpack 4,我们开发了这个工具来将源代码打包成一个独立的文件。
为了更好地爬取 DOM 上的信息,我们构建前端爬虫脚本时,如果传递 crawlerInjectJQuery
值为 true
,则将注入 jQuery 3.3.1 slim 版本。这样在写前端爬虫脚本时,可以直接用 jQuery 了。
按照 custom preload script 的要求,注入脚本中必须加上一段特殊的代码,以便于与 electron 通信。我们已经在打包时进行了自动处理,已注入了 nightmare-preload.js 。
利用 webpack 按照规则进行构建。构建完成之后会生成构建文件。
matmanConfig
: MatmanConfig
, 参考 matman 组件FAQs
Easy to write build preload script in nightmare
The npm package matman-crawler receives a total of 3 weekly downloads. As such, matman-crawler popularity was classified as not popular.
We found that matman-crawler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.