您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
添加文章时间。支持csdn,掘金,思否,博客园,stackoverflow,知乎专栏。有问题发邮件:[email protected]
当前为
// ==UserScript== // @name 提示文章时间 // @namespace xky1000.cn // @match https://blog.csdn.net/* // @match https://juejin.cn/* // @match https://segmentfault.com/* // @match https://www.jianshu.com/p/* // @match https://www.cnblogs.com/*/p/* // @match https://stackoverflow.com/questions/* // @match https://zhuanlan.zhihu.com/p/* // @version 0.1.0 // @author xky // @grant GM_addStyle // @license MIT // @description 添加文章时间。支持csdn,掘金,思否,博客园,stackoverflow,知乎专栏。有问题发邮件:[email protected] // ==/UserScript== GM_addStyle(`#show_timer { position: fixed; top: 0; left: 0; z-index: 10000; background-color: #ff9999; padding: 0 13px 0 10px; font-size: 10px } `) function show(text) { let date = new Date(text); let year = date.getFullYear(); let month = date.getMonth() + 1; let day = date.getDate(); let div = document.createElement('div') div.id = 'show_timer' div.innerText = `${year}/${month}/${day}` document.body.appendChild(div); } function route(url) { if (document.URL.indexOf(url) !== -1) { return true; } } try { if (route('https://blog.csdn.net')) { show(document.querySelector('.time').innerText); } else if (route('https://juejin.cn')) { setTimeout(() => { show(document.querySelector('.meta-box .time').dateTime); }, 500) } else if (route('https://segmentfault.com')) { show(document.querySelector('time').dateTime); } else if (route('https://www.jianshu.com')) { show(document.querySelector('time').dateTime); } else if (route('https://www.cnblogs.com')) { show(document.querySelector('#post-date').innerText); } else if (route('https://stackoverflow.com')) { show(document.querySelector('.relativetime').title); } else if (route('https://zhuanlan.zhihu.com')) { show(document.querySelector('.ContentItem-time').innerText.slice(4)); } } catch (e) { console.log(e) }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址