Skip to content

Page@unroute not working #96

@SvenvanderHoeven

Description

@SvenvanderHoeven

Hey there,

Still using and enjoying this package a lot.

Page@route() is working well, but Page@unroute() isn't. So I couldn't unset my network interceptor, which is actually needed in my use-case.

My workaround was to set/unset my network interceptor on BrowserContext level, that works perfectly. So by no means a high priority fix

When looking at the source code, my bet is that the problem that in Page@unroute(), the command is sent to the BrowserContext, instead of the page itself:

public function route(string $url, callable $handler): void
{
    $this->eventHandler->onRoute($handler);
    $this->sendCommand('route', ['url' => $url]);
}

public function unroute(string $url, ?callable $handler = null): void
{
    $this->context->unroute($url, $handler);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions