Add badge menu and library

Clicking a badge now opens a menu instead of the video: copy a
YouTube-style card image (thumbnail + title) to the clipboard, copy the
title and link as text, download the card image, or save the video into
the extension's own library page. The library groups entries into
projects, supports search, moving, two-step deletes, JSON export with a
field-level lossless import merge, and re-scores stale entries on open.

Badge clicks are swallowed at window capture so YouTube's own handlers
(notably on Shorts cards) never see them, and a fixed-position ghost
copy of the badge keeps it visible and clickable above the hover
preview overlay. Score tier colors and labels now live in one place
(OBParse) shared by the badge, the watch panel, and the library.
This commit is contained in:
2026-08-30 16:43:32 +03:00
parent 5e35cf1074
commit 0ed9dbf41a
21 changed files with 1616 additions and 48 deletions
+2
View File
@@ -47,6 +47,8 @@
<select id="language"></select>
</label>
<button id="library" type="button" class="wide" data-i18n="popupLibrary"></button>
<div class="stats" id="stats"></div>
<button id="clear" type="button" class="wide" data-i18n="popupClear"></button>
+8
View File
@@ -5,6 +5,9 @@
var api = (typeof browser !== "undefined" ? browser : chrome);
var T = OBI18n;
/* Sadece youtube.com: kapaklar (i.ytimg.com) ACAO:* gönderdiği için host
* izni istemez ve buraya eklemek, sadece youtube iznini vermiş mevcut
* kullanıcılara güncellemede yersiz bir uyarı gösterirdi. */
var ORIGINS = { origins: ["*://www.youtube.com/*"] };
var FIELDS = [
@@ -108,6 +111,11 @@
});
});
$("library").addEventListener("click", function () {
api.tabs.create({ url: api.runtime.getURL("library/library.html") });
window.close();
});
$("clear").addEventListener("click", function () {
OBStore.clearBaselines().then(function () {
$("stats").textContent = T.t("popupCleared");