summaryrefslogtreecommitdiff
path: root/source/libs
diff options
context:
space:
mode:
authorGravatar yakov116 <16872793+yakov116@users.noreply.github.com> 2020-04-12 18:51:25 -0400
committerGravatar GitHub <noreply@github.com> 2020-04-13 00:51:25 +0200
commited2dc7b08b52efe00dcca41248ce35ef7f5ef04f (patch)
tree97a017fd6cbe6c381d90507cc9ab4460c9695205 /source/libs
parent15600fe3303abee0724665356de9e0cedf06517e (diff)
downloadrefined-github-ed2dc7b08b52efe00dcca41248ce35ef7f5ef04f.tar.gz
refined-github-ed2dc7b08b52efe00dcca41248ce35ef7f5ef04f.tar.zst
refined-github-ed2dc7b08b52efe00dcca41248ce35ef7f5ef04f.zip
Add `discussion-links-on-repo-lists` feature (#2981)
Co-Authored-By: Federico Brigante <opensource@bfred.it>
Diffstat (limited to 'source/libs')
-rw-r--r--source/libs/page-detect.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/libs/page-detect.ts b/source/libs/page-detect.ts
index 8dbe9a73..2c48d300 100644
--- a/source/libs/page-detect.ts
+++ b/source/libs/page-detect.ts
@@ -67,7 +67,8 @@ export const _isDashboard = [
'https://github.com/orgs/edit/dashboard',
'https://github.big-corp.com/',
'https://not-github.com/',
- 'https://my-little-hub.com/'
+ 'https://my-little-hub.com/',
+ 'https://github.com/?tab=repositories' // Gotcha for `isUserProfileRepoTab`
];
export const isEnterprise = (): boolean => location.hostname !== 'github.com' && location.hostname !== 'gist.github.com';
@@ -373,6 +374,11 @@ export const _isBranches = [
export const isUserProfile = (): boolean => select.exists('.user-profile-nav');
export const _isUserProfile = domBased;
+export const isUserProfileRepoTab = (): boolean =>
+ isUserProfile() &&
+ new URLSearchParams(location.search).get('tab') === 'repositories';
+export const _isUserProfileRepoTab = domBased;
+
export const isSingleTagPage = (): boolean => /^(releases\/tag)/.test(getRepoPath()!);
export const _isSingleTagPage = [
'https://github.com/sindresorhus/refined-github/releases/tag/v1.0.0-beta.4',