I’ve only recently switched from Firefox to the Brave browser. In FF you would type about:config and enter dom. allow_scripts_to_close_windows. In Brave I think you choose brave