INNER CODE UNIT · Python

RefusingDispatcher

feder-cr/invisible_playwright · src/invisible_playwright/_juggler/server.py:102

class RefusingDispatcher(Dispatcher):
    """An object that exists so the tree is well formed, and refuses the rest.

    ⛔ IT EXISTS BECAUSE THE PROTOCOL REQUIRES IT, NOT BECAUSE WE SUPPORT IT.
    `BrowserContext`'s initializer names a `tracing`, a `debugger` and a
    `requestContext`, and `_browser_context.py` reads all three with
    `from_channel` at construction time. Leaving them out does not disable
    tracing: it raises a KeyError before any page exists.

    So they are created, and every method on them refuses with a reason. That is
    the whole of section 5.4: out of perimeter must FAIL LOUDLY, never no-op and
    never AttributeError.
    """

    REASON = "not implemented"

    def call(self, method: str, params: Dict) -> Any:
        if method in self.METHODS:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…