Closed Gofake1 closed 6 years ago
Cool, thanks for the update. Wouldn't it be great if the new nightlight would be ready for Mojave ? :) I'm curious: What changes do you plan to make nightlight perform more efficently ?
Web browsers already implement a way to efficiently update the appearance of multiple elements by way of CSS. The current Nightlight design uses MutationObserver and the DOM API to update the appearances of elements. This works, but there are edge cases where this is suboptimal (see my blog post).
The new design I have in mind takes a webpage's stylesheets, "darkens" them, and injects them back and overrides the originals. The "darkening" process could be expensive, so the generated stylesheets will probably be cached.
The app extension is at a point where I'm happy with it. It's not a perfect translation from the old JS extension because the native SafariServices API is more limited:
Native code provides some advantages:
Modifying CSS works better than modifying DOM elements directly in most cases:
I'm going to start preparing for a release on the App Store.
Thanks for the update, David. If you still need a beta tester let me know ! :)
On 7 Sep 2018, at 01:43, David notifications@github.com wrote:
Closed #10 https://github.com/Gofake1/Nightlight/issues/10.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Gofake1/Nightlight/issues/10#event-1831698699, or mute the thread https://github.com/notifications/unsubscribe-auth/ACtKm1zjya2IIzWo5eyYlzt9tNac2PxHks5uYbMbgaJpZM4UzGnV.
In case you haven't heard, Safari 12 will deprecate Javascript extensions, and Apple will stop accepting updates to the Gallery after 2018.
A native Safari App Extension offers some advantages:
Since this is the only way forward, I will stop maintaining the Javascript extensions.
In other news, I will change how Nightlight works (from walking the DOM to injecting stylesheets). This should be both more efficient and produce better-looking results.
I haven't been updating Nightlight for a while, and this is my way of letting everyone know that it will continue to be a while before Nightlight reaches 1.0. Thanks for your patience.