notifier-for-github icon indicating copy to clipboard operation
notifier-for-github copied to clipboard

feature request: more lax condition for `reuse notification tabs when possible`

Open scarf005 opened this issue 1 year ago • 0 comments

The issue

the condition for reuse notification tabs when possible is too strict, opening new notifications tab frequently over existing tabs (e.g with unread).

To reproduce

  1. enable reuse notification tabs when possible.
  2. open https://github.com/notifications?query=.
  3. click notifier for github icon image
  4. a new notifications tab will be created despite notifications tab was open in 3

Feature request

when searching for tabs for reuse notification tabs when possible, only check against https://github.com/notifications and trim away query parameters.

> new URL('https://github.com/notifications?query=')
URL {
  href: "https://github.com/notifications?query=",
  origin: "https://github.com",
  protocol: "https:",
  username: "",
  password: "",
  host: "github.com",
  hostname: "github.com",
  port: "",
  pathname: "/notifications",
  hash: "",
  search: "?query="
}
> const strippedURL = (url: URL) => `${url.origin}${url.pathname}`
undefined
> strippedURL(new URL("https://github.com/notifications?query="))
"https://github.com/notifications"

scarf005 avatar Jun 05 '24 02:06 scarf005