您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Replace month-day-year dates with day-month-year dates.
- // ==UserScript==
- // @name Fix date formats
- // @namespace http://tampermonkey.net/
- // @version 0.2
- // @description Replace month-day-year dates with day-month-year dates.
- // @match *://*/*
- // @require https://code.jquery.com/jquery-3.6.0.min.js
- // @license MIT
- // ==/UserScript==
- (function() {
- 'use strict';
- //Get all text nodes in a given container
- //Source: http://stackoverflow.com/a/4399718/560114
- function getTextNodesIn(node, includeWhitespaceNodes) {
- var textNodes = [], nonWhitespaceMatcher = /\S/;
- function getTextNodes(node) {
- if (node.nodeType == 3) {
- if (includeWhitespaceNodes || nonWhitespaceMatcher.test(node.nodeValue)) {
- textNodes.push(node);
- }
- } else {
- for (var i = 0, len = node.childNodes.length; i < len; ++i) {
- getTextNodes(node.childNodes[i]);
- }
- }
- }
- getTextNodes(node);
- return textNodes;
- }
- var j = jQuery.noConflict();
- var textNodes = getTextNodesIn( j("body")[0], false );
- var i = textNodes.length;
- var node;
- while (i--) {
- node = textNodes[i];
- node.textContent = node.textContent.replace(/([A-Z][a-z]{2,8}|[A-Z][a-z]{2}\.) (\d{1,2}), (\d{4})/g, '$2 $1 $3');
- }
- })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址