Well, I did a ton of testing, and it turns out that changing the CSS doesn't always update instantly the browser. Some optimisation seems to make it very inconsistant.
I did end up finding a way around that though: Instead of using a timeout, using requestAnimationFrame seems to force the update to instantly update on the next frame.
Here is a new addon that uses that technique.
mega.nz/file/Z4cBwABC
I also went back to updating the body instead of html, and I forced both to cover the whole window.
One issue I had with only updating for a short while was that the timer (that was partially outside) would start tearing as soon as the plugin stopped the forced rendering to occur. And when closing the overlay, sometimes, there would be residual overlays until i moved, resized, or unfocused the game window.
What ended up working great however was refreshing every 3 ticks: imgur.com/a/ki77Wi0
Also, I'd like to mention this issue on github about the windows 10 title bar:
github.com/nwjs/nw.js/issues/7362
So people here know: this flag only worked for me when I put it at the very start of the chromium args list.
Between this and the new forceredraw addon and some other flags shenanigans, we now have a fully working overlay inside NW.js v 0.46.0!
Here are my chromium args:
"chromium-args": "--disable-windows10-custom-titlebar --disable-plugins --disable-internal-flash --disable-popup-blocking --enable-gamepad --enable-html5-camera --allow-file-access-from-files --ignore-gpu-blacklist --limit-fps=60 --disable-devtools --in-process-gpu --disable-direct-composition"