Check that window.focus() is not restricted during notification click events.
To exercise manually, disable pop-up blocking, grant notification permissions and load this page, then click on the notification. You should see two "PASS" messages and this window should be focused.