An open API service indexing awesome lists of open source software.

https://github.com/cloud-org/stealth.min.js

The resulting JS file can be used in pure CDP implementations or to test the evasions in your devtools.
https://github.com/cloud-org/stealth.min.js

javascript python selenium

Last synced: 27 days ago
JSON representation

The resulting JS file can be used in pure CDP implementations or to test the evasions in your devtools.

Awesome Lists containing this project

README

        

## stealth.min.js

selenium 过环境检测

```sh
npx extract-stealth-evasions
```

```python
with open('./stealth.min.js') as f:
inject_js = f.read()

driver.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {
"source": inject_js
})
```

### 效果

- 注入前

![](./img/previous.png)

- 注入后

![](./img/after.png)

### 参考资料

- https://blog.csdn.net/weixin_42453905/article/details/122086184
- http://fengpiaoxus.com/blog/detail/3/
- https://github.com/berstend/puppeteer-extra/tree/master/packages/extract-stealth-evasions#readme