webgpu_inspector
webgpu_inspector copied to clipboard
URL issue
For some URLs like http://localhost:5800 I'm getting Failed to construct 'URL': Invalid URL in https://github.com/brendan-duncan/webgpu_inspector/blob/dbb8ebc8d034b6d0cd573e0c4573e9c88cd457e5/src/webgpu_inspector.js#L2019
Can you provide a small repo? I tried a few URL patterns like you suggested, but haven't hit the error yet.
I found a repo for the error. Not sure if it's the same issue you have or not. I pushed an update to github that seems to get around the problem I saw in testing, which is the pattern new Worker("/foo/bar.js").
Thanks for looking into this! Yes I just checked the url and it's indeed a path without hostname which new URL() then throws an error for.
It still throws an error during the URL construction here. In my case the URL is: http://localhost:5800./js/test.js. Changing the URL construction to _url = new URL(`${baseUrl.protocol}//${baseUrl.host}/${url}`); fixed it for me
Thanks for the extra info, I'll look into it soon. I suppose the additional fix is to check if url starts with a "/" or not, and add the "/" if not.
I pushed a fix for that to git.
It works, thanks a lot!
@brendan-duncan Is it possible to get this fix released to the chrome extension?
Oh yeah, sure. I got distracted by work and forgot. I'll push a chrome store update today, and it'll take a day or so for it to go public.
I submitted the update to the chrome store.
It's on the store now. I'll go ahead and close the ticket.