Metadata-Version: 2.2
Name: angdh-v8
Version: 1.0.5
Summary: Python V8 runtime with a lightweight browser DOM
License: MIT
Requires-Python: <4,>=3.9
Description-Content-Type: text/markdown

# angdh_v8

Python V8 runtime with a lightweight browser DOM.

## Install

```bash
python -m pip install angdh_v8 -i https://pypi.org/simple
```

## Public Python API

`JSContext` is keyword-only and requires `license_hash`. The maintained API
guide, handler schemas, capability configuration, and examples live in
[`docs/api/PYTHON_API.md`](docs/api/PYTHON_API.md).

`timeout` 限制最外层 V8 Task，但不能抢占同步 Python 回调；超时只能在
回调返回后报告。回调永不返回时，同一 Context 上等待的操作也不会返回，且
回调后的 JavaScript 是否继续执行不可依赖。

`add_resource()` / `load_page()` 的最终 HTTP `status` 只接受非 `bool` 的
Python `int`，范围为 `200..599`。`opaque=True` 时 JavaScript 看到的 `0` 是
Fetch 过滤结果，不是可传入的资源状态。`load_page(error=...)` 与显式
`status=...` 互斥，并在任何 ResourceBundle 或 Realm 变更前失败。

<!-- README_PYTHON_API_CONSTRUCTOR_PARAMETERS_START -->
- `license_hash`
- `timezone`
- `width`
- `height`
- `timeout`
- `memory_limit`
- `mode`
- `dialog_handler`
- `fetch_handler`
- `file_picker_handler`
- `image_decode_handler`
- `audio_codec_handler`
- `video_codec_handler`
- `push_handler`
- `remote_playback_handler`
- `speech_synthesis_handler`
- `presentation_handler`
- `device_access_handler`
- `xr_handler`
- `gpu_handler`
- `ink_handler`
- `shared_storage_handler`
- `websocket_handler`
- `webrtc_handler`
- `browser_capabilities`
<!-- README_PYTHON_API_CONSTRUCTOR_PARAMETERS_END -->

<!-- README_PYTHON_API_METHODS_START -->
- `dispatch_input_event(selector, event_type, options=None)`
- `dispatch_input_click(selector)`
- `navigate()`
- `set_dialog_handler(handler)`
- `set_fetch_handler(handler)`
- `dispatch_websocket_event(connection_id, event)`
- `dispatch_webrtc_event(peer_id, event)`
- `dispatch_media_session_action(action, details=None)`
- `dispatch_remote_playback_event(remote_id, event)`
- `dispatch_speech_synthesis_event(utterance_id, event)`
- `dispatch_presentation_event(connection_id, event)`
- `set_file_picker_handler(handler)`
- `set_image_decode_handler(handler)`
- `expose(callable, name=None)`
- `set_permission_state(name, state)`
- `with_devtools(port=9229, *, break_on_start=True, log_path='out.log', debugger_name=None, trace_scope='js')`
- `close()`
- `heap_statistics()`
- `lifecycle_profile()`
- `load_html_profile()`
- `network_log()`
- `add_network_diagnostic_entry(entry)`
- `resource_snapshot()`
- `navigation_requests()`
- `frame_document_snapshot()`
- `frame_window_snapshot()`
- `add_resource(url, body='', *, status=None, headers=None, error=None, redirect_url=None, opaque=False, delay=0)`
- `load_html(html, *, base_url='about:blank')`
- `load_page(snapshot=None, *, html=None, base_url=None, resources=None, headers=None, status=None, error=None, delay=None, parser_timer_checkpoint=None)`
- `tick(milliseconds)`
- `tick_profile(milliseconds)`
- `drain()`
- `eval(code, *, to_py=True, filename='<eval>', line_offset=0, column_offset=0)`
<!-- README_PYTHON_API_METHODS_END -->
