message: `stop-redirecting-in-notification-bar` automatically when possible
diff: @@ -7,11 +7,15 @@ const hasNotificationBar = (): boolean =>
  JSON.parse(sessionStorage.notification_shelf ?? '{}').pathname === location.pathname;
  function handleClick(event: delegate.Event<MouseEvent, HTMLButtonElement>): void {
  - // Also restores the attribute on successive non-alt clicks
  - event.delegateTarget.form!.toggleAttribute('data-redirect-to-inbox-on-submit', !event.altKey);
  + // Disable the redirect to the Notifications inbox if either:
  + // 1. The alt key was held down during click (user choice)
  + // 2. The notification has been opened in a new tab (the inbox is still open in the previous tab)
  + const redirectDisabled = event.altKey || sessionStorage.rghIsNewTab === 'true';
  + event.delegateTarget.form!.toggleAttribute('data-redirect-to-inbox-on-submit', !redirectDisabled);
  }
  async function init(): Promise<void> {
  + sessionStorage.rghIsNewTab = history.length === 1;
  delegate(document, '.notification-shelf .js-notification-action button', 'click', handleClick);
  }
  