Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Obscura and Moli

Two more CDP server engines.

Two more experimental headless engines that are their own CDP server, like Lightpanda: navigera starts each as <engine> serve on a free port. Unlike Lightpanda they open tabs and contexts and lay pages out, so they take Chrome’s paths; each session gets a browser of its own.

  • --engine obscura (experimental; tested on Obscura 0.2.7, its newest stable release) starts obscura serve --allow-private-network: Obscura refuses loopback and private addresses otherwise, and a local dev server is what agents test. The binary comes from $OBSCURA_BIN or PATH, or from --chromium. Tabs, contexts, layout and screenshots work as on Chrome. Differences:
    • popups: a page opened with target=_blank loads in the current tab (Obscura opens no target for it); tab-new works.
    • dialogs: Obscura’s own alert, confirm and prompt answer at once and raise no event (confirm() false, prompt() null). navigera puts its own in each tab’s documents: they answer as dialog says and each dialog is reported as on Chrome. A page’s script sees them as plain functions; they are checked in the top document only, not in frames.
    • input during a navigation the page started (a script or a form): a key or click sent meanwhile answers only once the new document has loaded (Obscura #921): 1.5 s for a document that takes 1.5 s, where Chrome answers in under 3 ms.
    • shadow roots: its mouse events go to document.elementFromPoint, the shadow host, so a press never reaches an element inside a shadow root. navigera asks each engine it starts as a CDP server once, with a button in a shadow root on its first tab; where the press stops at the host, a click on an element inside one gets its pointer and mouse events from the page (composed, so the host’s listeners hear them too) once the usual checks passed. A page that checks isTrusted sees them as false.
    • its accessibility tree’s root has no name and no URL, and Accessibility.getRootAXNode answers nothing: ax reads the whole tree and takes the title and URL from the page.
    • its accessibility tree is the top document’s light DOM only: no shadow root’s content and no frame’s document. navigera asks each engine it starts as a CDP server once whether an open shadow root’s button is in its tree; where it is not, ax lists what open shadow roots and same-origin frames hold after the tree, under - shadow root of <tag> and - document of <iframe> "<title>", without refs (target those elements with --text).
    • a multiple <select> takes one option (select --add is refused), and there is no Clipboard API.
    • eval: Obscura runs a script it is asked to check for side effects, so navigera can’t tell a read from a change there and runs every eval as an action (the page’s change watch armed first), never as a read.
  • --engine moli (experimental; tested on Moli 1.1.27) starts moli serve --layout: without --layout Moli answers geometry from a fixed compatibility layout and paints nothing. The binary comes from $MOLI_BIN or PATH, or from --chromium. Tabs, popups (as tabs), dialogs and screenshots work as on Chrome. Differences:
    • layout: Moli builds it at the first geometry read and keeps it until a screenshot, so an element a script adds afterwards has no box and no innerText there. navigera takes a 1x1 screenshot before it reads boxes or text (an element op, text, ax, eval, each 100 ms of a wait) when a document (the page’s or a same-origin frame’s), its DOM, its scroll or its viewport changed since the last one: a whole layout, 1.7 ms on a small page, 157 ms on 4,500 nodes. Changes inside a shadow root aren’t counted, and an eval that changes the page and then reads a box reads the layout from before its change.
    • refs are Moli’s node ids, large numbers ([ref=2000000017]).
    • a <select>’s value in ax is the selected option’s value, not its label.
    • roles in ax: a file input is file where Chrome says button, and a <details> summary’s toggle is button where Chrome says DisclosureTriangle.

Made from docs/navigera.md.