notifier-for-github
notifier-for-github copied to clipboard
feature request: more lax condition for `reuse notification tabs when possible`
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
- enable
reuse notification tabs when possible. - open
https://github.com/notifications?query=. - click notifier for github icon
- 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"