rom-runtime 0.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rom_runtime-0.0.2/Cargo.toml +47 -0
- rom_runtime-0.0.2/PKG-INFO +102 -0
- rom_runtime-0.0.2/README.md +74 -0
- rom_runtime-0.0.2/bindings/gom-python/Cargo.lock +1611 -0
- rom_runtime-0.0.2/bindings/gom-python/Cargo.toml +20 -0
- rom_runtime-0.0.2/bindings/gom-python/README.md +74 -0
- rom_runtime-0.0.2/bindings/gom-python/rust/lib.rs +12 -0
- rom_runtime-0.0.2/bindings/gom-python/scripts/smoke.py +22 -0
- rom_runtime-0.0.2/crates/rom-core/Cargo.toml +13 -0
- rom_runtime-0.0.2/crates/rom-core/src/engine.rs +92 -0
- rom_runtime-0.0.2/crates/rom-core/src/error.rs +11 -0
- rom_runtime-0.0.2/crates/rom-core/src/lib.rs +5 -0
- rom_runtime-0.0.2/crates/rom-runtime/Cargo.toml +18 -0
- rom_runtime-0.0.2/crates/rom-runtime/examples/fingerprintjs_report.rs +13 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/bin/rom_bridge.rs +39 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/bridge.rs +111 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/compat.rs +214 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/config.rs +90 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/error.rs +13 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/fingerprintjs.rs +188 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/lib.rs +596 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/runtime.rs +41 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_adjacent_html.rs +65 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_character_data.rs +103 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_classlist.rs +63 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_collections.rs +51 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_comments.rs +55 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_cookies.rs +378 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_cors.rs +377 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_css.rs +52 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_dataset.rs +53 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_dom_mutations.rs +148 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_dom_navigation.rs +58 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_events.rs +95 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_eventsource/parsing.rs +251 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_eventsource.rs +571 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_fetch_semantics.rs +865 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_file_reader.rs +85 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_fragments.rs +67 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_history.rs +286 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_innerhtml.rs +121 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_layout_observers.rs +95 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_messaging.rs +614 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_mutation_observer.rs +105 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_navigator.rs +146 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_node_equality.rs +57 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_node_helpers.rs +108 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_normalize.rs +69 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_parsing.rs +82 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_performance.rs +166 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_selectors.rs +72 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_split_text.rs +117 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_timers.rs +74 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_viewport.rs +84 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_webcrypto/advanced.rs +446 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_webcrypto/jwk.rs +117 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_webcrypto/lengths.rs +336 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_webcrypto/params.rs +499 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_webcrypto/wrapping.rs +182 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_webcrypto.rs +420 -0
- rom_runtime-0.0.2/crates/rom-runtime/src/tests_websocket.rs +571 -0
- rom_runtime-0.0.2/crates/rom-runtime/tests/bridge_cli.rs +64 -0
- rom_runtime-0.0.2/crates/rom-webapi/Cargo.toml +34 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/bootstrap.rs +317 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/config.rs +38 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/host_crypto/aes.rs +387 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/host_crypto/core.rs +181 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/host_crypto/gcm.rs +138 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/host_crypto/ops.rs +276 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/host_crypto/types.rs +194 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/host_crypto.rs +494 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/host_fetch/client.rs +479 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/host_fetch/proxy.rs +108 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/host_fetch.rs +185 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/host_url.rs +68 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/host_websocket.rs +411 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_body.js +627 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_cookie.js +328 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_crypto.js +457 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_crypto_params.js +491 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_dom.js +1409 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_eventsource.js +276 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_fetch.js +687 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_globals.js +1010 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_messaging.js +654 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_navigator.js +471 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_observers.js +344 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_parser.js +171 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_prelude.js +470 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_textcodecs.js +331 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_url.js +303 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_urlpattern.js +221 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_viewport.js +130 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_websocket.js +346 -0
- rom_runtime-0.0.2/crates/rom-webapi/src/lib.rs +9 -0
- rom_runtime-0.0.2/pyproject.toml +39 -0
- rom_runtime-0.0.2/src/rom/__init__.py +92 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
[workspace]
|
|
2
|
+
members = [
|
|
3
|
+
"crates/rom-core",
|
|
4
|
+
"crates/rom-webapi",
|
|
5
|
+
"crates/rom-runtime",
|
|
6
|
+
]
|
|
7
|
+
default-members = [
|
|
8
|
+
"crates/rom-core",
|
|
9
|
+
"crates/rom-webapi",
|
|
10
|
+
"crates/rom-runtime",
|
|
11
|
+
]
|
|
12
|
+
resolver = "2"
|
|
13
|
+
|
|
14
|
+
[workspace.package]
|
|
15
|
+
edition = "2024"
|
|
16
|
+
homepage = "https://github.com/Rxflex/rom"
|
|
17
|
+
license = "MIT"
|
|
18
|
+
repository = "https://github.com/Rxflex/rom"
|
|
19
|
+
version = "0.1.0"
|
|
20
|
+
|
|
21
|
+
[workspace.dependencies]
|
|
22
|
+
aes = "0.8.4"
|
|
23
|
+
aes-kw = "0.2.1"
|
|
24
|
+
aes-gcm = "0.10.3"
|
|
25
|
+
base64 = "0.22.1"
|
|
26
|
+
boring = "5.0.2"
|
|
27
|
+
cbc = "0.1.2"
|
|
28
|
+
hkdf = "0.12.4"
|
|
29
|
+
hmac = "0.12.1"
|
|
30
|
+
getrandom = "0.3.3"
|
|
31
|
+
httparse = "1.10.1"
|
|
32
|
+
pbkdf2 = "0.12.2"
|
|
33
|
+
rcgen = "0.14.7"
|
|
34
|
+
rom-core = { path = "crates/rom-core" }
|
|
35
|
+
rom-runtime = { path = "crates/rom-runtime" }
|
|
36
|
+
rom-webapi = { path = "crates/rom-webapi" }
|
|
37
|
+
rquickjs = "0.11.0"
|
|
38
|
+
rustls = "0.23.37"
|
|
39
|
+
serde = { version = "1.0.228", features = ["derive"] }
|
|
40
|
+
serde_json = "1.0.145"
|
|
41
|
+
sha1 = "0.10.6"
|
|
42
|
+
sha2 = "0.10.9"
|
|
43
|
+
thiserror = "2.0.17"
|
|
44
|
+
tungstenite = { version = "0.28.0", features = ["rustls-tls-native-roots"] }
|
|
45
|
+
typenum = "1.19.0"
|
|
46
|
+
ureq = "3.2.0"
|
|
47
|
+
url = "2.5.7"
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rom-runtime
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
7
|
+
Classifier: Operating System :: OS Independent
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Rust
|
|
15
|
+
Classifier: Topic :: Internet
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
17
|
+
Summary: Python wrapper for the ROM browser-like runtime
|
|
18
|
+
Keywords: rom,runtime,browser,web-api,fingerprint
|
|
19
|
+
Home-Page: https://github.com/Rxflex/rom
|
|
20
|
+
Author: Rxflex
|
|
21
|
+
License: MIT
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
24
|
+
Project-URL: Homepage, https://github.com/Rxflex/rom
|
|
25
|
+
Project-URL: Issues, https://github.com/Rxflex/rom/issues
|
|
26
|
+
Project-URL: Repository, https://github.com/Rxflex/rom
|
|
27
|
+
|
|
28
|
+
# `rom-runtime`
|
|
29
|
+
|
|
30
|
+
Python bindings for the ROM browser-like runtime.
|
|
31
|
+
|
|
32
|
+
This package exposes a thin Python API on top of ROM:
|
|
33
|
+
|
|
34
|
+
- `eval()`
|
|
35
|
+
- `eval_async()`
|
|
36
|
+
- `eval_json()`
|
|
37
|
+
- `surface_snapshot()`
|
|
38
|
+
- `fingerprint_probe()`
|
|
39
|
+
- `run_fingerprintjs_harness()`
|
|
40
|
+
- `fingerprintjs_version()`
|
|
41
|
+
|
|
42
|
+
It prefers a native `PyO3` extension when available and falls back to the ROM CLI bridge otherwise.
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install rom-runtime
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Usage
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from rom import RomRuntime, has_native_binding
|
|
54
|
+
|
|
55
|
+
runtime = RomRuntime(
|
|
56
|
+
{
|
|
57
|
+
"href": "https://example.test/",
|
|
58
|
+
"cors_enabled": False,
|
|
59
|
+
"proxy_url": None,
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
href = runtime.eval_async("(async () => location.href)()")
|
|
63
|
+
snapshot = runtime.surface_snapshot()
|
|
64
|
+
|
|
65
|
+
print("native:", has_native_binding())
|
|
66
|
+
print(href)
|
|
67
|
+
print(snapshot["fetch"])
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Config keys use the Rust runtime field names, so use snake_case such as `cors_enabled` and `proxy_url`.
|
|
71
|
+
`cors_enabled` is `False` by default.
|
|
72
|
+
|
|
73
|
+
## Optional native build from source
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
python -m pip install maturin
|
|
77
|
+
python -m maturin build --manifest-path bindings/gom-python/Cargo.toml --release
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Tagged GitHub releases build and publish wheels for Linux, Windows, and macOS, plus an sdist for source installs.
|
|
81
|
+
|
|
82
|
+
## Common methods
|
|
83
|
+
|
|
84
|
+
- `eval()`
|
|
85
|
+
- `eval_async()`
|
|
86
|
+
- `eval_json()`
|
|
87
|
+
- `surface_snapshot()`
|
|
88
|
+
- `fingerprint_probe()`
|
|
89
|
+
- `run_fingerprintjs_harness()`
|
|
90
|
+
- `fingerprintjs_version()`
|
|
91
|
+
|
|
92
|
+
## Environment
|
|
93
|
+
|
|
94
|
+
- `ROM_FORCE_CLI_BRIDGE=1`: disable the native path and force CLI fallback
|
|
95
|
+
- `ROM_BRIDGE_BIN`: explicit path to the `rom_bridge` executable
|
|
96
|
+
- `ROM_BRIDGE_CWD`: working directory used by the CLI fallback
|
|
97
|
+
|
|
98
|
+
## More docs
|
|
99
|
+
|
|
100
|
+
- Root guide: [../../README.md](../../README.md)
|
|
101
|
+
- LLM guide: [../../LLMS.md](../../LLMS.md)
|
|
102
|
+
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# `rom-runtime`
|
|
2
|
+
|
|
3
|
+
Python bindings for the ROM browser-like runtime.
|
|
4
|
+
|
|
5
|
+
This package exposes a thin Python API on top of ROM:
|
|
6
|
+
|
|
7
|
+
- `eval()`
|
|
8
|
+
- `eval_async()`
|
|
9
|
+
- `eval_json()`
|
|
10
|
+
- `surface_snapshot()`
|
|
11
|
+
- `fingerprint_probe()`
|
|
12
|
+
- `run_fingerprintjs_harness()`
|
|
13
|
+
- `fingerprintjs_version()`
|
|
14
|
+
|
|
15
|
+
It prefers a native `PyO3` extension when available and falls back to the ROM CLI bridge otherwise.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install rom-runtime
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from rom import RomRuntime, has_native_binding
|
|
27
|
+
|
|
28
|
+
runtime = RomRuntime(
|
|
29
|
+
{
|
|
30
|
+
"href": "https://example.test/",
|
|
31
|
+
"cors_enabled": False,
|
|
32
|
+
"proxy_url": None,
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
href = runtime.eval_async("(async () => location.href)()")
|
|
36
|
+
snapshot = runtime.surface_snapshot()
|
|
37
|
+
|
|
38
|
+
print("native:", has_native_binding())
|
|
39
|
+
print(href)
|
|
40
|
+
print(snapshot["fetch"])
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Config keys use the Rust runtime field names, so use snake_case such as `cors_enabled` and `proxy_url`.
|
|
44
|
+
`cors_enabled` is `False` by default.
|
|
45
|
+
|
|
46
|
+
## Optional native build from source
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
python -m pip install maturin
|
|
50
|
+
python -m maturin build --manifest-path bindings/gom-python/Cargo.toml --release
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Tagged GitHub releases build and publish wheels for Linux, Windows, and macOS, plus an sdist for source installs.
|
|
54
|
+
|
|
55
|
+
## Common methods
|
|
56
|
+
|
|
57
|
+
- `eval()`
|
|
58
|
+
- `eval_async()`
|
|
59
|
+
- `eval_json()`
|
|
60
|
+
- `surface_snapshot()`
|
|
61
|
+
- `fingerprint_probe()`
|
|
62
|
+
- `run_fingerprintjs_harness()`
|
|
63
|
+
- `fingerprintjs_version()`
|
|
64
|
+
|
|
65
|
+
## Environment
|
|
66
|
+
|
|
67
|
+
- `ROM_FORCE_CLI_BRIDGE=1`: disable the native path and force CLI fallback
|
|
68
|
+
- `ROM_BRIDGE_BIN`: explicit path to the `rom_bridge` executable
|
|
69
|
+
- `ROM_BRIDGE_CWD`: working directory used by the CLI fallback
|
|
70
|
+
|
|
71
|
+
## More docs
|
|
72
|
+
|
|
73
|
+
- Root guide: [../../README.md](../../README.md)
|
|
74
|
+
- LLM guide: [../../LLMS.md](../../LLMS.md)
|