From 689ef70e41468a70e39c28f157783d9fda2545ac Mon Sep 17 00:00:00 2001 From: zhenghaoz Date: Sat, 22 Nov 2025 11:04:16 +0800 Subject: [PATCH] upgrade extension UI --- extension/content.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/extension/content.js b/extension/content.js index b659d93..89c3020 100644 --- a/extension/content.js +++ b/extension/content.js @@ -7,10 +7,12 @@ $(document).ready(function () { if (!loaded) { loaded = true; const splits = location.pathname.split('/').filter(s => s); - if (splits.length === 2 && $("#repo-stars-counter-star").length > 0) { + if (splits.length >= 2 && $("#repo-stars-counter-star").length > 0) { itemId = splits[0] + ':' + splits[1]; // mark read - chrome.runtime.sendMessage({ read: itemId }, () => { }); + if (splits.length == 2) { + chrome.runtime.sendMessage({ read: itemId }, () => { }); + } // get neighbors loadSimilarRepos(); } else if (splits.length === 0) { @@ -159,8 +161,8 @@ async function showRecommend(result) { let exploreDiv = $("[aria-label='Explore']"); exploreDiv.children("[aria-label='GitRec']").remove(); let template = ` -
-

Explore repositories

`; +
+

Explore repositories

`; if (result.message) { let errorMessage = ""; if (result.message.startsWith('API rate limit exceeded')) {