您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically updates the title when using Google's timer
当前为
- // ==UserScript==
- // @name Google Timer Title Update
- // @namespace org.alorel.googletimer
- // @author Alorel <a.molcanovas@gmail.com>
- // @description Automatically updates the title when using Google's timer
- // @include https://*google.*/search?*
- // @version 1.0
- // @icon https://cdn.rawgit.com/AlorelUserscripts/google-timer-title-switcher/master/icon.png
- // @run-at document-end
- // @grant GM_info
- // ==/UserScript==
- (function (document, MutationObserver) {
- var timerArea,
- container,
- title;
- if (container = document.querySelector("#act-timer-section>div")) {
- timerArea = container.querySelector("div");
- title = document.querySelector("head>title");
- (function () {
- var faviconElement;
- if (faviconElement = document.querySelector('link[rel="shortcut icon"]')) {
- faviconElement.setAttribute("href", GM_info.script.icon);
- faviconElement = null;
- }
- })();
- (new MutationObserver(function () {
- if (container.classList.contains("act-tim-paused")) {
- title.innerText = "PAUSED";
- } else if (container.classList.contains("act-tim-finished")) {
- title.innerText = "FINISHED";
- } else {
- title.innerText = timerArea.innerText.trim();
- }
- })).observe(timerArea, {
- childList: true,
- attributes: true,
- characterData: true,
- subtree: true
- });
- }
- })(document, MutationObserver);
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址