Skip to content

tools: Support tab navigation via navigateTo, goBack, and goForward#43026

Merged
eerii merged 3 commits into
servo:mainfrom
brentschroeter:devtools-navigation
Mar 6, 2026
Merged

tools: Support tab navigation via navigateTo, goBack, and goForward#43026
eerii merged 3 commits into
servo:mainfrom
brentschroeter:devtools-navigation

Conversation

@brentschroeter
Copy link
Copy Markdown
Contributor

@brentschroeter brentschroeter commented Mar 5, 2026

Add support for navigation requests ("navigateTo", "goBack", and "goForward") over the Remote Debugging Protocol. These may be sent by a UI client in response to user input (for example the address bar in the Firefox inspector), or they can be used to automate navigation during unit tests.

This currently only supports navigation within the URL domain at which servoshell is initially launched, due to a bug in servo's BrowsingContextActor implementation. (Unit tests covering a fix for that issue will depend on this change.)

Testing: The behavior of all 3 new message types is covered by a new test case—test_navigation—in the devtools unit test suite.
Fixes: #38668

@brentschroeter brentschroeter requested a review from gterzian as a code owner March 5, 2026 07:00
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 5, 2026
@brentschroeter
Copy link
Copy Markdown
Contributor Author

Requesting the appropriate testing label (T-linux-wpt?) for this PR. I have run through ./mach test-devtools locally on macOS, but should make sure that the new test works equally well in the CI environment.

@mukilan mukilan requested review from atbrakhi and eerii March 5, 2026 08:27
Copy link
Copy Markdown
Member

@eerii eerii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it locally and it works pretty nice :) thanks!

For future reference (not this PR), remaining work in the navigation area that I can think of:

  • Make the URL bar in DevTools update when navigating.
  • Fix the inspector, as it breaks when navigating. I think one of the culprits here is that we are cloning the pipeline_id and script_sender from the browsing context actor to the inspector actor when we create it, but it is never updated. It would be better to pass the browsing context name and get the pipeline / sender from it, like you do here for tab.

Comment thread components/devtools/actors/tab.rs
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Mar 5, 2026
Co-authored-by: eri <[email protected]>
Signed-off-by: Brent Schroeter <[email protected]>
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 5, 2026
@brentschroeter
Copy link
Copy Markdown
Contributor Author

Tested it locally and it works pretty nice :) thanks!

For future reference (not this PR), remaining work in the navigation area that I can think of:

* Make the URL bar in DevTools update when navigating.

* Fix the inspector, as it breaks when navigating. I think one of the culprits here is that we are cloning the `pipeline_id` and `script_sender` from the browsing context actor to the inspector actor when [we create it](https://github.com/servo/servo/blob/main/components/devtools/actors/browsing_context.rs#L223), but it is never updated. It would be better to pass the browsing context name and get the pipeline / sender from it, like you do here for `tab`.

Thanks! I've been working on the other points you mention, and nearly have the inspector working across navigation, on a WIP branch. Updating the pipeline and sender correctly in InspectorActor—and BrowsingContextActor—is the first step, and then Firefox also requires a very specific sequence of RDP messages to convince the client to recognize and use the new DOM walker correctly. I'm ironing out lingering bugs in the implementation and should have PRs ready for review in a few days once changes can be unit tested. 🤞

@eerii
Copy link
Copy Markdown
Member

eerii commented Mar 6, 2026

That is great, thank you! Feel free to tag me in any other patch for a review :)

@eerii eerii enabled auto-merge March 6, 2026 09:04
@eerii eerii added this pull request to the merge queue Mar 6, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 6, 2026
Merged via the queue into servo:main with commit 4c69d85 Mar 6, 2026
33 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 6, 2026
offline-ant pushed a commit to offline-ant/havi that referenced this pull request Jun 4, 2026
…ervo#43026)

Add support for navigation requests ("navigateTo", "goBack", and
"goForward") over the Remote Debugging Protocol. These may be sent by a
UI client in response to user input (for example the address bar in the
Firefox inspector), or they can be used to automate navigation during
unit tests.

This currently only supports navigation within the URL domain at which
servoshell is initially launched, due to a bug in servo's
`BrowsingContextActor` implementation. (Unit tests covering a fix for
that issue will depend on this change.)

Testing: The behavior of all 3 new message types is covered by a new
test case—`test_navigation`—in the devtools unit test suite.
Fixes: servo#38668

---------

Signed-off-by: Brent Schroeter <[email protected]>
Co-authored-by: eri <[email protected]>
(cherry picked from commit 4c69d85)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Navigation inputs don't work in remote devtools

3 participants