Merge pull request #186 from Nezteb/develop

Make selectors for repo author and name more specific to avoid conflicts with other GitHub extensions
This commit is contained in:
Enix 2021-10-31 00:20:58 +08:00 committed by GitHub
commit 1c9d477520
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,8 +7,8 @@ import { CopyFileButton, copyFileButtonClassName } from './CopyFileButton'
export function resolveMeta(): Partial<MetaData> {
const metaData = {
userName: $('[itemprop="author"]', e => e.textContent?.trim()),
repoName: $('[itemprop="name"]', e => e.textContent?.trim()),
userName: $('[itemprop="author"] > a[rel="author"]]', e => e.textContent?.trim()),
repoName: $('[itemprop="name"] > a[href]', e => e.textContent?.trim()),
branchName: getCurrentBranch(true),
}
if (!metaData.userName || !metaData.repoName) {