This doesn't fix the issue of the bright flash but makes it shorter.
The `load` event is fired when the page and all resources are fully
loaded while the `DOMContentLoaded` event is fired when initial HTML
document has been completely loaded and parsed, without waiting for
stylesheets, images, and subframes to finish loading.