You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If trace is relative, trace-viewer resolves it from it's hostname (localhost:9323 in the example above).
Then all other checks run as usual, e.g. checking for file:// scheme.
I've checked the trace-viewer sources, looks like it could be achieved by a tiny change next to getting trace URLs:
I use trace-viewer URLs in a custom HTML reporter. The report file is served via a local HTTP server, started by the user on a random port. Since the port is unknown beforehand, I cannot generate reliable trace-viewer URLs.
This small addition will simplify integration with third-party tools and help the Playwright ecosystem evolve.
The text was updated successfully, but these errors were encountered:
To support relative URLs in the trace parameter, we need to address the ambiguity. When I provide trace=/path/to/trace.zip, should the trace-viewer pass it through to look up on the filesystem, or should it prepend its own hostname?
I could introduce a query parameter, isUrl=true, to indicate that the provided path is expected to be a URL.
What do you think?
Thinking about this further, why do you not know the current port? You know your current hostname and port; does that not match the Trace Viewer server?
I'm serving trace-viewer from a local static webserver, started as npx http-server. It picks free port randomly.
If I start it with the hardcoded port (e.g. npx http-server --port 1234) then I also need to configure my custom reporter to generate trace-viewer links with that port, like trace/index.html?trace=http://localhost:1234/data/.... That is less convenient and actually duplicates the config.
I think, it would be useful to make trace-viewer "servable" from a regular static server.
I assume it will also simplify a couple of places in the Playwright itself, where currently http server aliases trace/file?path=xxx to serve the xxx path statically. I found it here and here.
🚀 Feature Request
I propose to add support of relative URLs to the trace-viewer
trace
parameter.Example
Currently, trace-viewer URLs look like this:
I'd like to request a support of relative URLs in the
trace
param:If
trace
is relative, trace-viewer resolves it from it's hostname (localhost:9323
in the example above).Then all other checks run as usual, e.g. checking for
file://
scheme.I've checked the trace-viewer sources, looks like it could be achieved by a tiny change next to getting trace URLs:
If approved, I'm ready to submit a PR.
Motivation
I use trace-viewer URLs in a custom HTML reporter. The report file is served via a local HTTP server, started by the user on a random port. Since the port is unknown beforehand, I cannot generate reliable trace-viewer URLs.
This small addition will simplify integration with third-party tools and help the Playwright ecosystem evolve.
The text was updated successfully, but these errors were encountered: