你正在訪問的內容是外部程式的映像位址,僅用於使用者加速訪問,本站無法保證其可靠性。當前的連結位址(單點即可複製)為 https://greasyfork.org.cn/zh-CN/scripts/475701-twitch-sidebar-thumbnail-preview/discussions/318985,源站連結 點此以跳轉。
Hover over Channel in the Sidebar to see a Thumbnail Preview of the Stream on Twitch
Hi. The script cannot display thumbnails when channel display names contain non-ASCII characters (such as Chinese or Japanese, e.g. 超負荷(sam1268)), because it extracts the channel name from the displayed text instead of from the URL.
So I changed this:
const channel = element.querySelector("[title]").textContent.toLowerCase();
to this:
const linkElement = element.querySelector("a[href^='/']");
const channelUrl = linkElement.getAttribute("href");
const channel = channelUrl.split('/')[1].toLowerCase();
This version extracts the channel ID from the href URL instead of the displayed name, which makes it compatible with all character sets.