Night Mode Addon compatible with 27+?

Add-ons for Pale Moon and other applications
General discussion, compatibility, contributed extensions, themes, plugins, and more.

Moderators: FranklinDM, Lootyhoof

Walter Dnes
Astronaut
Astronaut
Posts: 652
Joined: 2015-07-30, 20:29
Location: Vaughan, ON, Canada

Re: Night Mode Addon compatible with 27+?

Unread post by Walter Dnes » 2018-07-31, 17:29

JustOff wrote:This error means that you not only disabled the devtools client (--disable-devtools), but also disabled the devtools server (--disable-devtools-server) that is required for Add-ons SDK, and I guess you patched the configure script, which should not allow you to do this. Thus, no Add-ons SDK based add-ons will work, including ANM, regardless of whether it uses devtools or not.
Moonchild wrote:And this, my friends, is why we ask to see your build configuration.
Actually, this may be why the developers are leary of people making ANY tweaks to mozconfig. The only EXPLICIT change I made versus the bog-standard build was the addition of ac_add_options --disable-devtools. Everything else was an implicit "ripple effect". Maybe there's some "logic" in the config files that says... "If we don't have a devtools client, then we obviously don't need a devtools server". For curiosity's sake, I'm now doing a build with...

Code: Select all

ac_add_options --disable-devtools
ac_add_options --enable-devtools-server
I'll report back with the results when the build finishes.
There's a right way
There's a wrong way
And then there's my way

Walter Dnes
Astronaut
Astronaut
Posts: 652
Joined: 2015-07-30, 20:29
Location: Vaughan, ON, Canada

Re: Night Mode Addon compatible with 27+?

Unread post by Walter Dnes » 2018-07-31, 18:53

Walter Dnes wrote:I'll report back with the results when the build finishes.
ANM does not work. So I guess if I want ANM, I'll have to keep devtools.
There's a right way
There's a wrong way
And then there's my way

JustOff

Re: Night Mode Addon compatible with 27+?

Unread post by JustOff » 2018-08-01, 16:33

I have no problems with building Pale Moon 28 without the devtools client using --disable-devtools, and ANM works there just fine. Perhaps you need to start a new topic in the appropriate dev section if you always lose the server when you disable the client, as this becomes a kind of offtopic here.

Bitech

Re: Night Mode Addon compatible with 27+?

Unread post by Bitech » 2018-08-17, 07:11

Advanced Night Mode causes some issues in PM28:
anm.PNG
This can happen either from dragging a tab outside the browser window to create a new window (the tab is still in the original window, new window is left blank) with that tab or simply making a new window (Ctrl+N)
anm1.PNG
In Youtube going to fullscreen doesn't cover the whole screen

JustOff

Re: Night Mode Addon compatible with 27+?

Unread post by JustOff » 2018-08-17, 09:27

Bitech wrote:Advanced Night Mode causes some issues in PM28
I can't reproduce any of these problems. Perhaps you have a conflict with other extensions or some special browser settings. Try to disable add-ons one by one to find the culprit or use a new profile. I need precise steps to reproduce the problems in order to deal with them.

MoonSavvy
Hobby Astronomer
Hobby Astronomer
Posts: 16
Joined: 2014-11-21, 17:22
Location: California

Re: Night Mode Addon compatible with 27+?

Unread post by MoonSavvy » 2018-08-17, 21:42

Firstly, big thanks @JustOff for the great extension that makes the web usable for folk who prefer to surf without excessive amounts of blinding white everywhere! :thumbup:

It seems there might be an issue on PM 28.0.0 with both Advanced Night Mode 1.0.8 + uMatrix (any version from 1.1.4) installed. Testing on a brand new profile to debug the issue, a minor glitch is occurring on new windows. The PM menu is appearing at the left of the Tab Bar even when the full Menu Bar is also enabled.

* Loading PM 28.0.0 initially brings up a new window as normal:
Normal-New-Window.png
Normal-New-Window.png (12.42 KiB) Viewed 1341 times
* Opening an additional new window (ie. Ctrl+N) results in the following instead:
PM28-ANM-uMatrix.png
PM28-ANM-uMatrix.png (12.14 KiB) Viewed 1341 times
This is in a profile with the full Menu Bar turned on, meaning that new windows shouldn't have the drop down PM menu at left of the Tab Bar. It is interesting that the glitch can be fixed (must be done in each new window, however, so only a temporary fix each time) as follows:

1) Right-click blank area of Tab Bar
2) Uncheck Menu Bar
3) Right-click blank area of Tab Bar
4) Check Menu Bar

After these steps the Tab Bar in the additional new window looks normal (ie. no additional menu at left) as per the first picture above.

Additional tests done include a new PM 28 profile with only uMatrix 1.1.4 installed (no other extensions at all) and the issue did not occur. The issue also did not occur in a PM 28 profile with ANM 1.0.8 installed but not uMatrix, even in combination with about 20 other regularly used extensions. Thus it appears to specifically be a PM 28.0.0 + ANM 1.0.8 + uMatrix issue.

Versions of uMatrix tested include 1.1.4 (last official XUL version), 1.1.18 (last XUL version easily built from source using "tools/make-firefox.sh all" command), 1.2.0 (with patch kindly provided here), and even 1.3.2 (last version successfully built by myself using basically same 1.2.0 patch -- versions from 1.3.4 onward all have display errors even after the patch and don't work correctly).

Finally, the issue described did not occur on any PM 27 version including 27.9.4 with ANM 1.0.7 or 1.0.8 and any of the uMatrix versions also installed. In case it matters, though probably not for these two extensions, some tech details: OS = Ubuntu 16.04 derivative (Mint Serena); Desktop Manger = MATE; Window Manager = Compiz).

Hopefully someone will be able to figure out what interaction between PM 28 + ANM + uMatrix is causing this glitch. Though it is pretty minor really and everything else about PM 28 seems great so far (in the first day of testing only, but looking good)!

Bitech

Re: Night Mode Addon compatible with 27+?

Unread post by Bitech » 2018-08-17, 23:35

JustOff wrote:
Bitech wrote:Advanced Night Mode causes some issues in PM28
I can't reproduce any of these problems. Perhaps you have a conflict with other extensions or some special browser settings. Try to disable add-ons one by one to find the culprit or use a new profile. I need precise steps to reproduce the problems in order to deal with them.
I did some more testing. This issue happens when both Advanced Night Mode (1.0.8) and Greasemonkey for Pale Moon (3.31.4) are enabled (and all greasemonkey scripts are disabled).

Also want to add that this only seems to happen when opening a 2nd window. Opening a 3rd or 4th window doesn't cause this issue.
Last edited by Bitech on 2018-08-17, 23:36, edited 1 time in total.

MoonSavvy
Hobby Astronomer
Hobby Astronomer
Posts: 16
Joined: 2014-11-21, 17:22
Location: California

Re: Night Mode Addon compatible with 27+?

Unread post by MoonSavvy » 2018-08-18, 00:17

Prompted by Bitech testing for issues in 3rd & 4th windows I did additional testing and here is some extra information. Again, my setup is PM 28.0.0 with ANM 1.0.8 + uMatrix both installed.

* ANM is not functional on the 1st tab in the 2nd window (the window with erroneous PM menu at left of Tab Bar), ie. the search page tested in the 1st tab of 2nd window has usual white background with black text, rather than the reverse provided by ANM.

* ANM is however functional on all tabs after the 1st (ie. 2nd tab, 3rd tab) in the 2nd window.

* If the four click Menu Bar toggle is done before loading a page in the 1st tab in the 2nd window, then ANM correctly functions on the page in the 1st tab.

* In any windows beyond the 2nd (ie. 3rd, 4th, etc) ANM is not functional at all on any page loaded in any tab. Also, the erroneous PM menu does not appear at the left of the Tab Bar. The 1st tab background for 3rd/4th/etc windows reflects that ANM is not working, as it is gray rather than black when the window first loads. Whereas in the 2nd window the 1st blank tab background is black, even though ANM does not function on the page loaded in that tab.

Hopefully all that makes a little sense! So there is apparently some issue with the function of ANM when creating any new window (with varying results for tabs in 2nd window and no ANM function at all beyond 2nd window, as described) under PM 28.0.0 with both ANM + uMatrix installed.

JustOff

Re: Night Mode Addon compatible with 27+?

Unread post by JustOff » 2018-08-18, 17:38

Thanks for reporting this. I'll take a closer look as soon as I have enough free time.

JustOff

Re: Night Mode Addon compatible with 27+?

Unread post by JustOff » 2018-08-19, 11:48

I confirm the issue described above, when using ANM together with uMatrix or Greasemonkey, however, I can not yet find the exact reason for this. Looks like the problem lies somewhere deep inside the new Add-ons SDK library contained in Pale Moon 28, and not in ANM itself. I'll try to cope with this, but it is unlikely to be done quickly.
Last edited by JustOff on 2018-08-19, 21:47, edited 1 time in total.

JustOff

Re: Night Mode Addon compatible with 27+?

Unread post by JustOff » 2018-08-19, 21:55

Looks like I managed to fix this problem in ANM 1.0.9.

Please note that although ANM is restartless, you need to manually restart the browser after the update this time.

MoonSavvy
Hobby Astronomer
Hobby Astronomer
Posts: 16
Joined: 2014-11-21, 17:22
Location: California

Re: Night Mode Addon compatible with 27+?

Unread post by MoonSavvy » 2018-08-22, 05:29

Thanks for the updated version. The issue with the extra menu appearing at left of the Tab Bar in 2nd window when running PM 28 + ANM + uMatrix is definitely fixed! :)

Some strange behaviors are now occurring for me apparently in combination with ANM 1.0.9 + Tab Mix Plus. These behaviors have been hard for me to replicate with exactness in a new blank user profile, but have rather been a little random in occurrence. Due TMP being in a dev or pre-release version phase right now to try fix issues with PM 28 it is quite likely mainly to do with some kind of bug(s) in that add-on and not a problem with ANM.

Here are some of the occurrences seen a number of times when running PM 28 + ANM 1.0.9 + TMP 0.5.0.5pre.180718a1 (the latest version from here):

* Multiple windows open immediately on startup of PM 28, sometimes 2 and sometimes 3 (ANM is functional as normal in all windows/tabs) and sometimes the home page loads in the first tab of one of the additional windows (rather than it being a blank new tab)

* When only one window opens at startup, in the 2nd/3rd/etc window opened the initial tab loads the home page even though the browser.newtab.url setting is "about:logopage"

* Sometimes ANM is not functional at all in any window of any tab and to fix this requires disabling TMP and restarting the browser, then ANM works fine again and TMP can be re-enabled and the browser restarted again, after which both ANM and TMP work fine once again (?!)

What's interesting is that these behaviors don't occur when only one of ANM or TMP is loaded, only when both are loaded. Also, I did not see these behaviors at all in combination with ANM 1.0.8 + TMP. Seems it is perhaps more likely to be issues with TMP at this stage and so guess I will need to post a message on the TMP forum to mention some of the behaviors seen with the latest dev version of TMP when used with PM 28.

Once again, thanks for the update to ANM, one of the most important extensions for Pale Moon and one of two (other one is uBlock) that I simply have to install on any new browser profile. It is the best night mode extension for any browser that I have used by far and that is based on also testing numerous such extensions on Firefox and Chromium. So ANM makes the web usable and makes Pale Moon extra unique, given ANM is only available for PM! Great job.

MoonSavvy
Hobby Astronomer
Hobby Astronomer
Posts: 16
Joined: 2014-11-21, 17:22
Location: California

Re: Night Mode Addon compatible with 27+?

Unread post by MoonSavvy » 2018-08-22, 06:35

When searching the forums just now about issues with TMP and PM 28, found this post about a new TMP test version. So I tried this version alongside ANM 1.0.9 and the strange behaviors mentioned in the post above (multiple windows sometimes loading on startup, home page loading instead of about:logopage, ANM occasionally failing to work at all until TMP is disable & browser restarted) are still continuing, though seemingly less frequently!

Maybe there is some kind of race condition occurring between ANM and TMP? So depending on the exact timing of the extensions loading on browser startup, there are different results observed. In any case, the latest version of TMP does indeed fix the mouse wheel scrolling through tabs, though still seems to have some kind of issue with ANM. Again, the random glitches point to TMP as the culprit, though the glitches do only occur with ANM also loaded.

JustOff

Re: Night Mode Addon compatible with 27+?

Unread post by JustOff » 2018-08-22, 17:29

MoonSavvy wrote:Some strange behaviors are now occurring for me apparently in combination with ANM 1.0.9 + Tab Mix Plus. These behaviors have been hard for me to replicate with exactness in a new blank user profile, but have rather been a little random in occurrence.
I'm afraid it will be difficult to deal with this problem while there are no precise steps to reproduce it, especially given that I do not use ANM on the main workplace. Are there any errors in the Browser Console when this happens?
So ANM makes the web usable and makes Pale Moon extra unique, given ANM is only available for PM! Great job.
Actually, ANM is just a fork of Dark Background and Light Text :roll:

MoonSavvy
Hobby Astronomer
Hobby Astronomer
Posts: 16
Joined: 2014-11-21, 17:22
Location: California

Re: Night Mode Addon compatible with 27+?

Unread post by MoonSavvy » 2018-08-23, 18:37

JustOff wrote:I'm afraid it will be difficult to deal with this problem while there are no precise steps to reproduce it, especially given that I do not use ANM on the main workplace. Are there any errors in the Browser Console when this happens?
Unfortunately I cannot provide exact steps to reliably replicate the observed behaviors, due the fact that the behaviors have occurred randomly as mentioned. For instance, using the following steps does not result in the same behavior each time (at least on my system):

1) Launch PM 28 and at the profile screen create a new blank profile

2) In the new blank profile install ANM 1.0.9

3) Without restarting the browser install TMP 0.5.0.5pre.180819a1-testbuild-ef675a1271d6

4) Now restart the browser as prompted by the TMP installation

After these simple steps the behavior observed unfortunately varies! Several times when doing these steps I have observed 2, 3 or even 5 new windows open immediately on restarting the browser after the TMP install. However, several times I have also seen only the usual single window open up. Also, even when multiple windows open on browser launch there are no errors whatsoever in the Browser Console and I have checked this many times.

Having now spent at least a couple of hours trying to debug the PM 28 + ANM 1.0.9 + TMP interactions I'm not able to spend more time on it at present. Fortunately, the issue with ANM being completely non-functional has only occurred once for me since installing the latest TMP test version, but it still required me to disable TMP and restart the browser to get ANM functional again. Also, the multiple windows opening on browser launch has not occurred on my main profile since the latest TMP, only on the debug profiles I have created.

So all in all the glitches as they are between ANM + TMP are pretty minor and don't have any serious impact on the use of these extensions in my main PM 28 profile. Perhaps with a newer TMP version the issues will mysteriously go away. Who knows?!
JustOff wrote:Actually, ANM is just a fork of Dark Background and Light Text :roll:
Somehow I never found that one even with all my searching for night mode type browser extensions and I did not realize ANM was a fork. Thanks for letting me know I overlooked this detail, as now I can use Dark Background and Light Text on my FF 52 ESR profile, as sometimes I like to use FF 52 for certain tasks (and "Night Mode Pro" which I was using in FF is no where near as good as DBLT/ANM).

Thanks again for your efforts in providing this fork of a great extension to keep it working well in PM (given the newer DBLT versions require WebExtensions in any case, which PM will never have). :)

MoonSavvy
Hobby Astronomer
Hobby Astronomer
Posts: 16
Joined: 2014-11-21, 17:22
Location: California

Re: Night Mode Addon compatible with 27+?

Unread post by MoonSavvy » 2018-09-06, 17:47

An update on the ANM 1.0.9 + TMP issues that were occurring for me under PM 28 (described in above posts). Since upgrading to the release version of TMP 0.5.5.0 a few days ago and also upgrading to PM 28.0.1 there hasn't been a single glitch with multiple windows opening or with ANM being randomly disabled. Having now tested numerous times on a brand new debug profile I have not been able to reproduce any unexpected behavior in PM 28.0.1 when using ANM 1.0.9 + TMP 0.5.5.0 release version.

So it seems that TMP was almost certainly the cause of the issues as suspected and the update to the new 0.5.5.0 release has seemingly fixed things. Just wanted to let you know. Also, my dad made a point of telling me the other day how much he also appreciates ANM due his failing eyesight (he's in his early 80s) and how hard it is for him to surf the web when there is too much white on the screen, due it tiring out his eyes too quickly. A great add-on and glad it is now working smoothly with all my other extensions under PM 28! :thumbup:

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2402
Joined: 2012-08-19, 20:32

Re: Night Mode Addon compatible with 27+?

Unread post by back2themoon » 2019-02-05, 18:25

Many thanks for another super-helpful extension, JustOff. A user here asks for a quick on/off switch or keyboard shortcut. I'll second that request. :)

JustOff

Re: Night Mode Addon compatible with 27+?

Unread post by JustOff » 2019-02-05, 18:48

Here is a workaround:

1. Install Dorando keyconfig
2. Go to Dorando keyconfig options (Menu → Tools → Add-ons → Dorando keyconfig → Options)
3. Click "Add a new key" button
4. Pick whatever name you want, for example "Advanced Night Mode toggle"
5. Check "Global"
6. Paste the following code:

Code: Select all

let prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
let key = 'extensions.AdvancedNightMode@Off.JustOff.enabled';
prefs.setBoolPref(key, ! prefs.getBoolPref(key));
7. "OK"
8. Assing some hotkey to newly created "key"
9. "Apply"
10. Enjoy!

Thanks go to Mikhail Khvoinitsky, the author of the original add-on :wave:

tooshorttoolong
Fanatic
Fanatic
Posts: 137
Joined: 2017-09-11, 14:28

Re: Night Mode Addon compatible with 27+?

Unread post by tooshorttoolong » 2019-02-05, 20:06

I agree that having to click twice, and the second time on a tiny checkbox, is a bit annoying, It would be great if a simple left-click on the main icon would switch the mode, while a right click would show the menu.

JustOff

Re: Night Mode Addon compatible with 27+?

Unread post by JustOff » 2019-02-05, 20:11

Unfortunately, the Mozilla Add-on SDK, with which the Advanced Night Mode is made, does not allow such fine tuning of the toolbar buttons.

Locked