From 067bce75bf8b968fc21d0e4ac917c9356802b148 Mon Sep 17 00:00:00 2001 From: Itay Adler Date: Mon, 12 Feb 2024 15:04:24 +0200 Subject: [PATCH 1/3] Support browserless.io: - Allow to pass session_id for ChromeRemoteInterface.RPC - Handle ssl_closed in websocket - Update tot json --- .gitignore | 1 + .tool-versions | 3 + browser_protocol.json | 25390 +++++++++++++++++++++++++++++++ lib/page_session.ex | 32 +- lib/websocket.ex | 5 + mix.lock | 29 +- priv/tot/protocol.json | 31814 ++++++++++++++++++++++++++------------- 7 files changed, 46570 insertions(+), 10704 deletions(-) create mode 100644 .tool-versions create mode 100644 browser_protocol.json diff --git a/.gitignore b/.gitignore index 12179ea..d7cb11f 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ erl_crash.dump # Also ignore archive artifacts (built via "mix archive.build"). *.ez +test.exs diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..e8107ee --- /dev/null +++ b/.tool-versions @@ -0,0 +1,3 @@ +elixir 1.15.7-otp-25 +erlang 25.3.2.8 +nodejs 18.16.0 diff --git a/browser_protocol.json b/browser_protocol.json new file mode 100644 index 0000000..f73d464 --- /dev/null +++ b/browser_protocol.json @@ -0,0 +1,25390 @@ +{ + "version": { + "major": "1", + "minor": "3" + }, + "domains": [ + { + "domain": "Accessibility", + "experimental": true, + "dependencies": [ + "DOM" + ], + "types": [ + { + "id": "AXNodeId", + "description": "Unique accessibility node identifier.", + "type": "string" + }, + { + "id": "AXValueType", + "description": "Enum of possible property types.", + "type": "string", + "enum": [ + "boolean", + "tristate", + "booleanOrUndefined", + "idref", + "idrefList", + "integer", + "node", + "nodeList", + "number", + "string", + "computedString", + "token", + "tokenList", + "domRelation", + "role", + "internalRole", + "valueUndefined" + ] + }, + { + "id": "AXValueSourceType", + "description": "Enum of possible property sources.", + "type": "string", + "enum": [ + "attribute", + "implicit", + "style", + "contents", + "placeholder", + "relatedElement" + ] + }, + { + "id": "AXValueNativeSourceType", + "description": "Enum of possible native property sources (as a subtype of a particular AXValueSourceType).", + "type": "string", + "enum": [ + "description", + "figcaption", + "label", + "labelfor", + "labelwrapped", + "legend", + "rubyannotation", + "tablecaption", + "title", + "other" + ] + }, + { + "id": "AXValueSource", + "description": "A single source for a computed AX property.", + "type": "object", + "properties": [ + { + "name": "type", + "description": "What type of source this is.", + "$ref": "AXValueSourceType" + }, + { + "name": "value", + "description": "The value of this property source.", + "optional": true, + "$ref": "AXValue" + }, + { + "name": "attribute", + "description": "The name of the relevant attribute, if any.", + "optional": true, + "type": "string" + }, + { + "name": "attributeValue", + "description": "The value of the relevant attribute, if any.", + "optional": true, + "$ref": "AXValue" + }, + { + "name": "superseded", + "description": "Whether this source is superseded by a higher priority source.", + "optional": true, + "type": "boolean" + }, + { + "name": "nativeSource", + "description": "The native markup source for this value, e.g. a `