From 5b0eee77004261fc088d6a9231db1d2059fe14e7 Mon Sep 17 00:00:00 2001 From: Grigory Date: Tue, 17 Feb 2026 16:26:35 +0500 Subject: [PATCH 1/6] add `isHome` & `isFeed` --- index.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/index.ts b/index.ts index fe4450b..c5724cb 100644 --- a/index.ts +++ b/index.ts @@ -61,6 +61,9 @@ TEST: addTests('isCompareWikiPage', [ 'https://github.com/brookhong/Surfingkeys/wiki/Color-Themes/_compare/8ebb46b1a12d16fc1af442b7df0ca13ca3bb34dc...80e51eeabe69b15a3f23880ecc36f800b71e6c6d', ]); +/** + * @deprecated Use `isHome` and/or `isFeed` instead + */ export const isDashboard = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && /^$|^(orgs\/[^/]+\/)?dashboard(-feed)?(\/|$)/.test(getCleanPathname(url)); TEST: addTests('isDashboard', [ 'https://github.com///', @@ -84,6 +87,18 @@ TEST: addTests('isDashboard', [ 'https://github.com/dashboard-feed', ]); +export const isHome = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && /^$|^dashboard(\/|$)/.test(getCleanPathname(url)); +TEST: addTests('isHome', [ + 'https://github.com', + 'https://github.com/dashboard', +]); + +export const isFeed = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && /^(feed|orgs\/[^/]+\/dashboard)(\/|$)/.test(getCleanPathname(url)); +TEST: addTests('isFeed', [ + 'https://github.com/feed', + 'https://github.com/orgs/refined-github/dashboard', +]); + export const isEnterprise = (url: URL | HTMLAnchorElement | Location = location): boolean => url.hostname !== 'github.com' && url.hostname !== 'gist.github.com'; TEST: addTests('isEnterprise', [ 'https://github.big-corp.com/', From 0ab755214aa493b2657f5100fd1cf84e249b2187 Mon Sep 17 00:00:00 2001 From: Grigory Date: Tue, 17 Feb 2026 16:34:29 +0500 Subject: [PATCH 2/6] correction --- index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index c5724cb..2c41c61 100644 --- a/index.ts +++ b/index.ts @@ -87,13 +87,13 @@ TEST: addTests('isDashboard', [ 'https://github.com/dashboard-feed', ]); -export const isHome = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && /^$|^dashboard(\/|$)/.test(getCleanPathname(url)); +export const isHome = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && /^$|^dashboard\/?$/.test(getCleanPathname(url)); TEST: addTests('isHome', [ 'https://github.com', 'https://github.com/dashboard', ]); -export const isFeed = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && /^(feed|orgs\/[^/]+\/dashboard)(\/|$)/.test(getCleanPathname(url)); +export const isFeed = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && /^(feed|orgs\/[^/]+\/dashboard)\/?$/.test(getCleanPathname(url)); TEST: addTests('isFeed', [ 'https://github.com/feed', 'https://github.com/orgs/refined-github/dashboard', From 4d0de6357706724fdf9d0b2e61009194c6c281a3 Mon Sep 17 00:00:00 2001 From: Grigory Date: Tue, 17 Feb 2026 16:40:31 +0500 Subject: [PATCH 3/6] test urls --- index.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/index.ts b/index.ts index 2c41c61..93bd94d 100644 --- a/index.ts +++ b/index.ts @@ -70,14 +70,12 @@ TEST: addTests('isDashboard', [ 'https://github.com//', 'https://github.com/', 'https://github.com', - 'https://github.com/orgs/test/dashboard', + 'https://github.com/orgs/refined-github/dashboard', 'https://github.com/dashboard/index/2', 'https://github.com//dashboard', 'https://github.com/dashboard', - 'https://github.com/orgs/edit/dashboard', - 'https://github.big-corp.com/', - 'https://not-github.com/', - 'https://my-little-hub.com/', + 'https://ghe.big-corp.com/', + 'https://ghe-instance.com/', 'https://github.com/?tab=repositories', // Gotcha for `isUserProfileRepoTab` 'https://github.com/?tab=stars', // Gotcha for `isUserProfileStarsTab` 'https://github.com/?tab=followers', // Gotcha for `isUserProfileFollowersTab` @@ -90,7 +88,19 @@ TEST: addTests('isDashboard', [ export const isHome = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && /^$|^dashboard\/?$/.test(getCleanPathname(url)); TEST: addTests('isHome', [ 'https://github.com', + 'https://github.com///', + 'https://github.com//', + 'https://github.com/', + 'https://github.com//dashboard', 'https://github.com/dashboard', + 'https://ghe.big-corp.com/', + 'https://ghe-instance.com/', + 'https://github.com/?tab=repositories', // Gotcha for `isUserProfileRepoTab` + 'https://github.com/?tab=stars', // Gotcha for `isUserProfileStarsTab` + 'https://github.com/?tab=followers', // Gotcha for `isUserProfileFollowersTab` + 'https://github.com/?tab=following', // Gotcha for `isUserProfileFollowingTab` + 'https://github.com/?tab=overview', // Gotcha for `isUserProfileMainTab` + 'https://github.com?search=1', // Gotcha for `isRepoTree` ]); export const isFeed = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && /^(feed|orgs\/[^/]+\/dashboard)\/?$/.test(getCleanPathname(url)); From 0d334adebc9e3429be3f69fda33244644cc8a135 Mon Sep 17 00:00:00 2001 From: Grigory Date: Tue, 17 Feb 2026 16:45:19 +0500 Subject: [PATCH 4/6] can't make anything better --- index.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/index.ts b/index.ts index 93bd94d..ceb74f1 100644 --- a/index.ts +++ b/index.ts @@ -74,8 +74,9 @@ TEST: addTests('isDashboard', [ 'https://github.com/dashboard/index/2', 'https://github.com//dashboard', 'https://github.com/dashboard', - 'https://ghe.big-corp.com/', - 'https://ghe-instance.com/', + 'https://github.big-corp.com/', + 'https://not-github.com/', + 'https://my-little-hub.com/', 'https://github.com/?tab=repositories', // Gotcha for `isUserProfileRepoTab` 'https://github.com/?tab=stars', // Gotcha for `isUserProfileStarsTab` 'https://github.com/?tab=followers', // Gotcha for `isUserProfileFollowersTab` @@ -93,8 +94,9 @@ TEST: addTests('isHome', [ 'https://github.com/', 'https://github.com//dashboard', 'https://github.com/dashboard', - 'https://ghe.big-corp.com/', - 'https://ghe-instance.com/', + 'https://github.big-corp.com/', + 'https://not-github.com/', + 'https://my-little-hub.com/', 'https://github.com/?tab=repositories', // Gotcha for `isUserProfileRepoTab` 'https://github.com/?tab=stars', // Gotcha for `isUserProfileStarsTab` 'https://github.com/?tab=followers', // Gotcha for `isUserProfileFollowersTab` From 033cc5cc3419e44974ced618871f54a888bee19b Mon Sep 17 00:00:00 2001 From: Grigory Date: Tue, 17 Feb 2026 17:04:50 +0500 Subject: [PATCH 5/6] reorder urls --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index ceb74f1..e67adc3 100644 --- a/index.ts +++ b/index.ts @@ -89,10 +89,10 @@ TEST: addTests('isDashboard', [ export const isHome = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && /^$|^dashboard\/?$/.test(getCleanPathname(url)); TEST: addTests('isHome', [ 'https://github.com', + 'https://github.com//dashboard', 'https://github.com///', 'https://github.com//', 'https://github.com/', - 'https://github.com//dashboard', 'https://github.com/dashboard', 'https://github.big-corp.com/', 'https://not-github.com/', From 6613eb40879f5bd0a47fc6cd2df3345d96f33ea9 Mon Sep 17 00:00:00 2001 From: Grigory Date: Wed, 18 Feb 2026 19:50:02 +0500 Subject: [PATCH 6/6] bump `github-reserved-names` --- package-lock.json | 85 +++-------------------------------------------- package.json | 2 +- 2 files changed, 5 insertions(+), 82 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7865742..a0146a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "11.1.2", "license": "MIT", "dependencies": { - "github-reserved-names": "^2.1.1" + "github-reserved-names": "^2.1.2" }, "devDependencies": { "@sindresorhus/tsconfig": "^8.1.0", @@ -820,19 +820,6 @@ "node": ">=6.0.0" } }, - "node_modules/@jridgewell/source-map": { - "version": "0.3.11", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", - "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25" - } - }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.5", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", @@ -2496,15 +2483,6 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true - }, "node_modules/builtin-modules": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-5.0.0.tgz", @@ -2719,15 +2697,6 @@ "dev": true, "license": "MIT" }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true - }, "node_modules/comment-parser": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", @@ -4982,9 +4951,9 @@ } }, "node_modules/github-reserved-names": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/github-reserved-names/-/github-reserved-names-2.1.1.tgz", - "integrity": "sha512-p8eMxZksQzh/z1awZz7NniSODL2QphpmpKNfGqPiN+BA/YjUaNtHkZoxK+kk/GP6go4imM1jprU0JAQG4tJ2mg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/github-reserved-names/-/github-reserved-names-2.1.2.tgz", + "integrity": "sha512-vW5VYxCXbJ5VmMyy+LMGHVrLWx3g+uUaqKvUydPcbny4SS+0+hgtRysnP4f9DhtOB/ObFIdAo8Hn0z9/u1OKXg==", "license": "MIT" }, "node_modules/glob-parent": { @@ -7489,18 +7458,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "license": "BSD-3-Clause", - "optional": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", @@ -7511,19 +7468,6 @@ "node": ">=0.10.0" } }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, "node_modules/spdx-correct": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", @@ -7944,27 +7888,6 @@ "url": "https://opencollective.com/synckit" } }, - "node_modules/terser": { - "version": "5.44.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.44.1.tgz", - "integrity": "sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw==", - "dev": true, - "license": "BSD-2-Clause", - "optional": true, - "peer": true, - "dependencies": { - "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.15.0", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", diff --git a/package.json b/package.json index e0a23f5..97e0a4b 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "xo": "xo" }, "dependencies": { - "github-reserved-names": "^2.1.1" + "github-reserved-names": "^2.1.2" }, "devDependencies": { "@sindresorhus/tsconfig": "^8.1.0",