jlfwong / speedscope

🔬 A fast, interactive web-based viewer for performance profiles.
https://www.speedscope.app
MIT License
5.59k stars 247 forks source link

Support relative URLs #357

Closed danvk closed 2 years ago

danvk commented 3 years ago

Fixes #312

This turns out not to be very deep: you have to pass an optional second parameter to the URL constructor to resolve relative URLs.

> new URL('/path/to/file#hashcode').pathnaem
VM252:1 Uncaught TypeError: Failed to construct 'URL': Invalid URL
    at <anonymous>:1:1
(anonymous) @ VM252:1
> new URL('/path/to/file#hashcode', 'http://example.com/').pathname
"/path/to/file"