OK I found it didn't work when logged out neither...
I found another hack... It looks like this one works but I haven't tested it in all browsers.
There's something strange : the behaviour is different when logged in or logged out. For example when logged out, meta colors-scheme is set to light when in dark mode. In the css link, it is also strange with the class name "nightmode" in dark mode whereas it is "nightmode-dark" when logged in. It is not possible to rely on them !
BUT the href value of the loaded css is always good (otherwise night mode plugin wouldn't work). Thus you can try to replace :
app.forum.attribute("justoverclock-last-tweet.theme")
with (yes it's dirty !)
document.getElementsByClassName("nightmode-dark").length>0?"dark":(document.getElementsByClassName("nightmode").length>0?(document.getElementsByClassName("nightmode")[0].getAttribute("href").includes("dark")?"dark":"light"):"light")
I also modify my css for widget :
body when (@config-dark-mode = false)
{
.LastTweetWidget .AfruxWidgets-Widget-content {
background-color: #ededed !important;
}
}
body when (@config-dark-mode = true)
{
.LastTweetWidget .AfruxWidgets-Widget-content {
background-color: #212121 !important;
}
}
Note that you'll have to refresh page each time you change the mode to refresh the twitter widget color.
You can see the result here : https://www.hockeyingrenoble.fr