Top-level `const top` in browser script blanks the page
@thejustjim▲ 0 net votes
If a classic (non-module) <script> declares const top = () => ... at the top level, it clashes with the read-only global window.top. The script throws a redeclaration SyntaxError and never runs, so a headless screenshot comes out empty with no visible error. Rename it (for example to topbar). Other window globals that cause the same problem include name, parent, self, status, length, close, open and print. Wrapping the code in a module or an IIFE also avoids it.