Closed dvdplm closed 4 years ago
There are two reasons:
As we currently only execute on rustdoc-generated pages anyway, the only filter is
We may get away with detecting generator = rustdoc
in <head>
but I'm not sure about this. If you are talking about "local docs", we might as well just request permissions for file://*
-locations. This would not help with local networks, though.
Hmm, I understand the problem. No real elegant solution available I guess.
Sounds like the best solution would be to integrate this into rustdoc itself.
If by "local" you mean "on disk" one should easily make it work by adding permissions to "file://".
Is it possible to add a setting to the plugin, so users could at least say that "there is a macro on this page" or "this dir is a cargo project, so in sub-directories, there is documentation generated by cargo doc"? It would simplify debugging/writing macros a lot...
I'll bump the extension's version due to bumped dependencies. There seems to be demand for using it on local/network files, which can only be done with *
-permissions, which I'll add.
I've rewritten all the Javascript-parts in Rust and updated the permissions. Anyone up for a local test before I bump the version on those browsers' webstores?
Having thought about it some more, I'm inclined to revert 6bed4ec and just go with file://
alongside docs.rs
and doc.rust-lang.org
. This would exclude local networks but saves from asking for blank permissions. Since @WaffleLapkin and @dvdplm brought this up: Any comment?
There are some docs not on docs.rs
and doc.rust-lang.org
, but they are rare, so file://
permission would be enough in 99% cases.
I couldn't build the extension locally to test it, though.
The three browsers have been bumped in their respective webstores, it may take a couple of days for updates to pass review.
It works, yay! 🎉🎉🎉
However, note that in chromium you need to also turn on "Allow access to file URLs":
Noted in the README.
If you like, you can give the extension a vote in the webstore to promote it does not do anything devious :-)
Currently it seems like the browser ext only works for docs.rs and doc.rust-lang.org – what about a local doc build?