Community
    • Login

    dark theme preference on main website doesn't work as expected.

    Scheduled Pinned Locked Moved General Discussion
    9 Posts 5 Posters 387 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      shocked-gamer
      last edited by

      my main browser is firefox, i noticed after a browsing history (cookies, cache, etc) that the main website doesn’t remember the dark theme preference.
      i select dark theme, and after a webpage refresh it reverts to white.
      using a new and clean firefox profile doesn’t solve the issue. other browsers like chrome or edge work as expected.

      up until yesterday and before i clean my firefox browsing history, the site was remembering the dark theme preference.

      PeterJonesP Lycan ThropeL 2 Replies Last reply Reply Quote 1
      • PeterJonesP Online
        PeterJones @shocked-gamer
        last edited by PeterJones

        @shocked-gamer ,

        As far as I know, you just go down to the bottom of that main page at https://notepad-plus-plus.org/, click the button to toggle it, and then your browser should remember the cookie it sets after that.
        145b215e-0916-4cc8-990c-4d4a0b956cda-image.jpeg

        I just tried with Chrome, and it remembered my setting when I exit and reload.

        If that’s not working for you – maybe Firefox is not remembering cookies for the main domain, for some reason, so check cookie settings?


        updated, to remove the comment about auto, since after a reread of your original post, I didn’t see anything about auto, so it was irrelevant

        1 Reply Last reply Reply Quote 1
        • Lycan ThropeL Offline
          Lycan Thrope @shocked-gamer
          last edited by Lycan Thrope

          @shocked-gamer ,
          @peterjones is right. I only use Firefox myselff, and it’s in dark mode right now…however, you have to be signed in. For instance, I always sign out. When I do, the light theme comes back on, until I again, sign in. I believe it’s linked into your account, and it apparently works, or it wouldn’t go dark after I’ve signed in.

          1 Reply Last reply Reply Quote 0
          • M Offline
            myfancytextgenerator
            last edited by

            One more specific Firefox setting worth checking, since clearing your history is what started this: go to Settings > Privacy & Security, then look under “Cookies and Site Data”. If “Delete cookies and site data when Firefox is closed” is ticked, the preference cookie the theme toggle sets gets wiped every time Firefox closes, so the site can never remember your choice. The toggle itself still works for the current page load, which matches what you are seeing.

            Also worth ruling out: any privacy or ad-blocking extension that clears cookies automatically, and whether you are opening the site in a private window (cookies there never persist). As a quick test, toggle dark theme on, then check whether a cookie for the site exists afterwards — if there isn’t one, the browser isn’t storing it at all, which points back to one of the above.

            1 Reply Last reply Reply Quote 0
            • MarkusBodenseeM Offline
              MarkusBodensee
              last edited by

              @shocked-gamer
              I have the same issue on my side. Normally I have Dark Theme switched to ON when I am on Notepad++ website. But every time, when I reload the Website (preferred by just pressing F5), the Theme reverts back to Light Theme. So unfortunately it seems this setting is not remembered somewhere in the cookies.

              I have learned in the meanwhile to live with it. Since I normally restore my old session in Firefox, I am used to do a Ctrl+Tab and F5 very fast for all Tabs. So switching this Dark Theme button is my every-two-days routine when Notepad++ website was open.

              I am not logged in with some Firefox account, so could be possible, that with an account, this setting is remembered like @lycan-thrope stated.

              PeterJonesP 1 Reply Last reply Reply Quote 0
              • PeterJonesP Online
                PeterJones @MarkusBodensee
                last edited by

                @MarkusBodensee , @lycan-thrope , @shocked-gamer ,

                I cannot replicate.

                I downloaded Firefox onto a Win10 VM I have, and I ran a blank, out-of-the box copy, no configurations yet, not signed into Firefox at all. I went to https://notepad-plus-plus.org/ , opened F12 to show the Web Developer Tools, went to Storage > Local Storage, and saw https://notepad-plus-plus.org/ had KEY=darkTheme with none when I am in the site’s light mode or screen when I am in the site’s dark mode. (Please note: my experiments are all with the OS and browser in light mode; it is just the website’s light-vs-dark that I’m experimenting with.)

                I set the site’s dark mode. Refresh the page, still in dark mode, still shows darkTheme=screen. Close Firefox. Run Firefox. Go to https://notepad-plus-plus.org/. Still in Dark Mode, F12 still shows darkTheme=screen

                Maybe when you’re signed out, it uses one set of LocalStorage, and when you’re signed in, it uses another LocalStorage? That’s just a guess, and I don’t have a firefox account, and am not going to bother creating one for this. So, for someone who has the problem: when you’re signed out, if you set it to dark mode, does it stick when you exit Firefox and come back in still signed out? Hmm, re-reading @markusbodensee’s post, this disagrees with what he said. I haven’t regularly used Firefox for the better part of a decade, so I’m out of my depth here… I am just trying to add some data – specifically, that for me, with default Firefox, not logged in, it does remember. So that’s highly pointing to specifics of Firefox installation/settings/plugins/etc.

                I double-checked, and my Settings > Privacy & Security had a section called “browsing data” (not “Cookies and Site Data” as @myfancytextgenerator reported). But that section had a setting called “Clear cookies and site data every time you close Firefox”, and that defaulted to not checkmarked.

                Lycan ThropeL MarkusBodenseeM 2 Replies Last reply Reply Quote 1
                • Lycan ThropeL Offline
                  Lycan Thrope @PeterJones
                  last edited by

                  @PeterJones ,
                  Two things I think is going on here. I thought he was talking about Notepad++ forums. There is no need, in the forums, to have a Firefox account or be signed in. That is what I’m talking about, when I say Firefox must be signed into the forums, for the dark mode of the forums to switch for me, upon signing in.

                  The website for NP++, I just need to click the setting at the bottom of the https://notepad-plus-plus.org/ and it goes dark. When I closed the page and opened in a new tab, it was already in dark mode, so that works as well, and yes, unless he’s referring to the forums, which I’ve described, his condition I can’t duplicate, either.

                  1 Reply Last reply Reply Quote 0
                  • MarkusBodenseeM Offline
                    MarkusBodensee @PeterJones
                    last edited by

                    @PeterJones said:

                    Hmm, re-reading @markusbodensee’s post, this disagrees with what he said.

                    It happens to me only when I do a refresh/reload of the website. So explicitly when I do a reload via the circled arrow or via F5 key, both do the same thing. Otherwise the dark mode setting is kept.

                    So visit website https://notepad-plus-plus.org/ and switch dark mode to on:

                    • click on top left banner of website to reload page --> stays in dark mode
                    • further navigation on the website --> stays in dark mode
                    • close firefox and reopen it again:
                      • visit website again --> stays in dark mode
                      • restore last session --> stays in dark mode

                    Switch:

                    • press circled arrow or via F5 key --> website switch to light mode
                    PeterJonesP 1 Reply Last reply Reply Quote 0
                    • PeterJonesP Online
                      PeterJones @MarkusBodensee
                      last edited by

                      @MarkusBodensee said:

                      press circled arrow or via F5 key --> website switch to light mode

                      Okay, when I try that in the VM firefox, then it does switch to light mode, and the value in Local Storage changes from darkTheme=screen to darkTheme=none.

                      At first blush, since Firefox is behaving weirdly (remembering it when you exit FF and reload the page, but forgetting it on F5/refresh-button), I would call that a bug in Firefox. But it might be that whatever javascript library the main Notepad++ website is using to set the Local Storage value has been optimized for Chrome syntax, and is doing something to confuse FF on F5/refresh. I don’t know enough about Local Storage, or the library that is used on the main website, to say more.

                      @lycan-thrope ,

                      I thought he was talking about Notepad++ forums.

                      He did say “on the main website”, which I took to mean the main product website, not this forum; but honestly, like you, on first blush, I thought he might be asking about the forum, which is why I explicitly referenced the main site’s URL in my reply, so there was no ambiguity which site I was talking about, and if I wasn’t talking about the right one, I was hoping @shocked-gamer would reply with clarification.

                      But, despite logging in a day after our initial pair of replies, @shocked-gamer has never replied, nor logged into the forum again after, so we might never know, or be able to help them.

                      There is no need, in the forums, to have a Firefox account or be signed in. That is what I’m talking about, when I say Firefox must be signed into the forums, for the dark mode of the forums to switch for me, upon signing in.

                      Regarding the forum: the forum colors are based on per-user preferences, so of course if you aren’t signed into the forum, it won’t use your forum-user’s settings. (anonymous users cannot change forum display settings.)

                      1 Reply Last reply Reply Quote 0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      • First post
                        Last post
                      The Community of users of the Notepad++ text editor.
                      Powered by NodeBB | Contributors