lukaslueg / macro_railroad_ext

Display syntax-diagrams for Rust-macros on docs.rs and doc.rust-lang.org
MIT License
185 stars 10 forks source link

Better macro_railroad_ext.css injection #12

Closed Folyd closed 2 years ago

lukaslueg commented 2 years ago

This would mean that the CSS gets injected into every page that the extension gets executed on (because we no longer rely on the isRustDoc() check), wouldn't it?

While the extension only gets loaded for rustdoc-specific pages due to the manifest, it does get loaded for all of file:// due to local docs. I'm fine with the change, but I'll make the css-prefixes even more unique if that's so, to avoid any chance of conflicts.

Folyd commented 2 years ago

This would mean that the CSS gets injected into every page that the extension gets executed on (because we no longer rely on the isRustDoc() check), wouldn't it?

Exactly.

I'm fine with the change, but I'll make the css-prefixes even more unique if that's so, to avoid any chance of conflicts.

A reasonable concern, thanks for reminding me. However, adding a css-prefix is an over-killer, so I'll close this PR.

lukaslueg commented 2 years ago

Thanks for the effort! We may come back to the idea when Manifest v3 becomes a thing because arguably the user has more fine-grained control over where the extension will get loaded.