Skip to content

Commit

Permalink
西元2025年01月06日 (週一) 08時03分40秒 CST
Browse files Browse the repository at this point in the history
  • Loading branch information
pulipulichen committed Jan 6, 2025
1 parent 936cde2 commit 43c529d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions GitHub.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,17 @@ function detectWeb(doc, url) {
// return "multiple";
// }
// }
let ogTitle = attr(doc, 'meta[property="og:title"]', 'content');

if (url.includes("/search?")) {
var rows = doc.querySelectorAll('[data-testid="results-list"] .search-title a');
if (rows.length > 0) {
return "multiple";
}

if (ogTitle === 'Build software better, together') {
return "multiple";
}
}

if (!doc.querySelector('meta[property="og:type"][content="object"]')) {
Expand All @@ -69,7 +75,6 @@ function detectWeb(doc, url) {
// }
// let path = url.split('/').slice(3, 5).join('/');

let ogTitle = attr(doc, 'meta[property="og:title"]', 'content');
if (ogTitle.startsWith('GitHub - ')) {
ogTitle = ogTitle.substring(9);
}
Expand Down Expand Up @@ -465,11 +470,6 @@ var testCases = [
"defer": true,
"items": "multiple"
},
{
"type": "web",
"url": "https://github.com/zotero/translators/pulls",
"items": false
},
{
"type": "web",
"url": "https://github.com/datacite/schema/tree/4.6.0",
Expand Down

0 comments on commit 43c529d

Please sign in to comment.