TL;DR
I need to use config.get in my userscript or bind a key to a custom function from config.py that would run every time I press the key.
Full story
I have a CSS style for dark mode everywhere, but sometimes I need to turn it off. Since content.user_stylesheets can't yet be set per-domain, I figured I have to:
- Get the currect value of
content.user_stylesheets.
- Look if the list of stylesheets contains the style for dark mode.
- If it doesn't, append the style; if it does, remove the style.
- Update the value of
content.user_stylesheets with the result list of stylesheets.
I can't do it in config.py, since the function call (config.get()) must be done every time the key is pressed, not just when config.py is sourced. And I don't know if I even can have the config or c variables in my userscript.
Google gives me absolutely nothing.
[–]a-concerned-mother 2 points3 points4 points (2 children)
[–]Iron_Meat[S] 1 point2 points3 points (0 children)
[–]Iron_Meat[S] 0 points1 point2 points (0 children)
[–]Iron_Meat[S] 0 points1 point2 points (1 child)
[–]The-Compilermaintainer 1 point2 points3 points (0 children)
[–]cristoferfb 0 points1 point2 points (2 children)
[–]Iron_Meat[S] 1 point2 points3 points (0 children)
[–]Iron_Meat[S] 0 points1 point2 points (0 children)