瀏覽代碼

fix: always open @-prefixed channel IDs on YT

Sv443 10 月之前
父節點
當前提交
83eda83ee7
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/dialogs/autoLike.ts

+ 3 - 1
src/dialogs/autoLike.ts

@@ -138,7 +138,9 @@ async function renderBody() {
     const nameElem = document.createElement("a");
     nameElem.classList.add("bytm-auto-like-channel-name", "bytm-link");
     nameElem.ariaLabel = nameElem.textContent = chanName;
-    nameElem.href = `https://${getDomain() === "ytm" ? "music." : ""}youtube.com/${chanId.startsWith("@") ? chanId : `channel/${chanId}`}`;
+    nameElem.href = (!chanId.startsWith("@") && getDomain() === "ytm")
+      ? `https://music.youtube.com/channel/${chanId}`
+      : `https://youtube.com/${chanId.startsWith("@") ? chanId : `channel/${chanId}`}`;
     nameElem.target = "_blank";
     nameElem.rel = "noopener noreferrer";
     nameElem.tabIndex = 0;