Ichrome

Latest version: v4.0.2

Safety actively analyzes 687918 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 11

4.0.2

remove `typing.Literal` for python3.7 compatible

https://github.com/ClericPy/ichrome/pull/147

4.0.1

1. add webapp route for /request_get to send get request with headers,proxy


python
======================= server code ===========================
from inspect import getsource

import requests


1. request_get demo
print(
requests.get(
"http://127.0.0.1:8009/chrome/request_get",
params={
"__url": "http://httpbin.org/get?a=1", # [required] target URL
"__proxy": "http://127.0.0.1:1080", # [optional]
"__timeout": "10", [optional]
"my_query": "OK", [optional] params for target URL
},
headers for target URL
headers={
"User-Agent": "OK",
"my_header": "OK",
"Cookie": "my_cookie1=OK",
},
cookies={"my_cookie2": "OK"}, [optional] cookies for target URL if headers["Cookie"] is None
).text,
flush=True,
)
<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">{
"args": {
"a": "1",
"my_query": "OK"
},
"headers": {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"Accept-Encoding": "gzip, deflate",
"Cookie": "my_cookie1=OK",
"Host": "httpbin.org",
"My-Header": "OK",
"Upgrade-Insecure-Requests": "1",
"User-Agent": "OK",
"X-Amzn-Trace-Id": "Root=1-654d0664-74457b4317c2f41d17b6a823"
},

4.0.0

1. add retry for clear_dir_with_shutil
2. add shutdown_reason for daemon
3. use ruff-format instead of yapf
4. add tab.run_js_snippets
5. **remove `ichrome.sync`.** new sync mode with ichrome.debugger. 139 https://github.com/ClericPy/ichrome/blob/master/examples_debug.py
6. rm null main_data_dir if _use_port_dir

3.2.0

- add Tab.info, Tab.get_info, Tab.new_tab, Tab.browserContextId, Tab.get_targets

`Tab.new_tab demo`

python
import asyncio

from ichrome import AsyncChromeDaemon


async def main():
async with AsyncChromeDaemon(headless=False, disable_image=True) as cd:
async with cd.incognito_tab() as tab:
url = 'http://www.bing.com/'
await tab.goto(url, timeout=3)
MUIDB = (await tab.get_cookies_dict([url])).get('MUIDB')
new_tab = await tab.new_tab()
tab_exist = bool(await tab.chrome.get_tab(new_tab.tab_id))
assert tab_exist
async with new_tab(auto_close=True) as tab:
same context, so same cookie
MUIDB2 = (await tab.get_cookies_dict([url])).get('MUIDB')
print(MUIDB, MUIDB2, MUIDB == MUIDB2)
assert MUIDB == MUIDB2
the new_tab auto closed
tab_exist = bool(await tab.chrome.get_tab(new_tab.tab_id))
assert not tab_exist


asyncio.run(main())

3.1.1

- fix missing tab0 while start_url is null, now default start_url is "about:blank"
- add `ChromeDaemon.cleanup_launched_pids` to atexit to kill all the chrome processes which `ichrome` launched.
- kill the chrome processed which not exiting
- update `tab.iter_fetch` methods
- now `tab.iter_fetch` will contain `networkId` to get response body while `requestStage` is `Response`.
- add `get_response` for events
- add `match_event` to filt the events with RequestPattern
- new version chrome forbidden `GET` method towards `/json/new` fixed 123

3.1.0

- add tab.scrollIntoView
- Merge pull request 118 from why2lyj/master
- add tab.set_geolocation_override
- EventBuffer.events type add Dict[str, Callable], Bind different callback functions for different events

Page 1 of 11

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.