您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Swap content and data-original-title attributes of span elements within divs of class post_actions date, and monitor for changes in the timeline div
// ==UserScript== // @name Show absolute time in timeline in bangumi // @namespace https://jirehlov.com/ // @version 0.2 // @description Swap content and data-original-title attributes of span elements within divs of class post_actions date, and monitor for changes in the timeline div // @author Jirehlov // @match https://bgm.tv/* // @match https://bangumi.tv/* // @match https://chii.in/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; let timelineId = null; function swapContentAndTitle() { document.querySelectorAll('div.post_actions.date').forEach(function(div) { div.querySelectorAll('span.titleTip').forEach(function(span) { const currentContent = span.textContent; const currentTitle = span.getAttribute('data-original-title'); span.textContent = currentTitle; span.setAttribute('data-original-title', currentContent); }); }); } function checkAndUpdateTimeline() { const timelineDiv = document.getElementById('timeline'); if (timelineDiv) { if (timelineId === null) { timelineId = timelineDiv; swapContentAndTitle(); observeTimelineChanges(); } else if (timelineDiv !== timelineId) { timelineId = timelineDiv; swapContentAndTitle(); } } } function observeTimelineChanges() { const observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (mutation.type === 'childList' || mutation.type === 'attributes') { checkAndUpdateTimeline(); } }); }); observer.observe(document.body, { childList: true, subtree: true, attributes: true }); } checkAndUpdateTimeline(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址