rust-search-extension icon indicating copy to clipboard operation
rust-search-extension copied to clipboard

`file://` URLs are not vaild, resulting in a warning

Open eirnym opened this issue 1 year ago • 6 comments

it's unfortunate to see Error: URL constructor: is not a valid URL. every time I open a local file. if URL can't be constructed with this scheme, please hide warning, it's really annoying

eirnym avatar Sep 28 '24 23:09 eirnym

Hi thanks for the feedback. Can you give a screenshot? Which platform do you use?

Folyd avatar Sep 29 '24 02:09 Folyd

I use Firefox on macOS if OS important. I found that Chromium-based browsers don't show most warnings, providing false sense of correctness.

Also I actively use dev tools and edit css there

eirnym avatar Sep 29 '24 09:09 eirnym

more information which could help:

While having style editor of an offline page (file:// protocol) open, I've opened a console below (!), style editor and inside styles I've introduced a mistake, which triggered the error, as you can see on a screenshot.

I guess source of the error is following: plugin parses everything on a screen and tries to guess if this a proper page to be applied to, and it parses devtools window as well.

Zrzut ekranu 2024-09-29 o 17 45 08

eirnym avatar Sep 29 '24 15:09 eirnym

Yes, Firefox doesn't allow file:// protocol, please see the FAQ: https://rust.extension.sh/faq/#why-local-file-rust-doc-not-work-properly-on-firefox

Folyd avatar Oct 16 '24 03:10 Folyd

@Folyd this is another issue.

Please, reopen it. I'd like warning to be removed entirely

eirnym avatar Oct 16 '24 10:10 eirnym

I've caught better exception. As I've said, it's possibly conflicting with devtools. As such URLs won't be used by extension anyway, I propose to silently ignore the error and/or have an option for it.

Błąd mapy źródła: Error: URL constructor:  is not a valid URL.
Stack in the worker:resolveSourceMapURL@resource://devtools/client/shared/source-map-loader/utils/fetchSourceMap.js:56:22
getOriginalURLs@resource://devtools/client/shared/source-map-loader/source-map.js:73:24
workerHandler/</<@resource://devtools/client/shared/worker-utils.js:115:52
workerHandler/<@resource://devtools/client/shared/worker-utils.js:113:13

URL zasobu: wasm:moz-extension://3db87862-495d-4099-9f7c-c69d5bbb5cf8/content_scripts/macro_railroad_ext.js%20line%2036%20%3E%20WebAssembly.compile
URL mapy źródła: null

eirnym avatar Jan 09 '25 20:01 eirnym