Open
Description
If multiple books are on the same host, changing the theme on one can magically change the theme on all the others.
Steps to Reproduce:
- Open up the first and second versions of the Rust Book in separate tabs
- Go to the first book and change its theme
- Refresh the second book's tab
You'll probably also see this if you use mdbook on multiple projects and have them hosted on GitHub Pages.
This is somewhat related to rust-lang/rust#44704 (see @steveklabnik's comment) in that local storage keys aren't handled as well as they could be.
mdbook stores the current theme in localstorage. This did change in newer/older mdbook, but it looks like this, basically:
var theme = localStorage.getItem('theme'); if (theme === null) { theme = 'light'; }
Ideally instead of using a key like "theme", it'd be namespaced. So in the case of the first Rust Book you might use "/book/first-edition:theme".
There may also be other cases where local storage handling allows cross-book contamination.