diff --git a/index.ts b/index.ts index 1feac72a..8ba83040 100644 --- a/index.ts +++ b/index.ts @@ -293,8 +293,8 @@ collect.set('isRepoHome', [ ]); export const isRepoRoot = (url?: URL | Location): boolean => - /^(tree\/[^/]+)?$/.test(getRepoPath(url ?? location)!) || - (!url && document.title.startsWith(getRepoURL()) && !document.title.endsWith(getRepoURL())); // #15 + /^(tree\/[^/]+)?$/.test(getRepoPath(url ?? location)!) && + (url ? true : (document.title.startsWith(getRepoURL()) && !document.title.endsWith(getRepoURL()))); // #15 collect.set('isRepoRoot', [ ...collect.get('isRepoHome') as string[], 'https://github.com/sindresorhus/refined-github/tree/native-copy-buttons', diff --git a/package.json b/package.json index 039cec61..c286f713 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "@rollup/plugin-typescript": "^4.1.2", "@sindresorhus/tsconfig": "^0.7.0", "@types/jsdom": "^16.2.3", - "ava": "^3.8.2", + "ava": "^3.10.0", "esm": "^3.2.25", "github-reserved-names": "^1.1.8", "jsdom": "^16.2.2",