您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
fixes the encode on strawpoll (no more å for example)
// ==UserScript== // @name Fix encode // @namespace Fix encode by C4illin // @match https://www.strawpoll.me/* // @grant none // @version 1.2 // @author C4illin // @description fixes the encode on strawpoll (no more å for example) // @license MIT; https://opensource.org/licenses/MIT // @copyright 2020, C4illin (https://github.com/C4illin) // ==/UserScript== function htmlDecode(input) { var doc = new DOMParser().parseFromString(input, "text/html") return doc.documentElement.textContent } let title = document.querySelector("meta[property='og:title']").content let mainText = document.querySelector("div#result-list > h1") if (mainText && title.endsWith("...")){ title = htmlDecode(mainText.textContent) console.log(title) } if(mainText) { mainText.textContent = title } if (title.length > 33) { title = title.slice(0, 32).trim() } document.getElementsByTagName("title")[0].textContent = (title + "… - Straw Poll")