So you can tell if something is really updated. Also for PCGamesTorrents.
当前为
// ==UserScript==
// @name IGGGAMES - Show Modified Time for Posts
// @description So you can tell if something is really updated. Also for PCGamesTorrents.
// @namespace RainSlide
// @author RainSlide
// @icon https://igg-games.com/favicon.ico
// @version 1.0
// @match https://igg-games.com/*
// @match https://pcgamestorrents.com/*
// @grant none
// ==/UserScript==
"use strict";
document.querySelectorAll('article.post[typeof="Article"]').forEach(
post => {
const modMeta = post.querySelector(':scope meta[property="dateModified"][content]');
const pubTime = post.querySelector(':scope time');
if (modMeta !== null && pubTime !== null) {
const $ = tagName => document.createElement(tagName);
const modISO = modMeta.content;
const modDate = new Date(modISO);
// if modDate is not Invalid Date
// modDate.toString !== "Invalid Date"
if (!Number.isNaN(modDate.getTime())) {
const modTime = Object.assign(
$("time"), {
dateTime: modISO,
textContent: modDate.toLocaleDateString("en-US", {dateStyle: "long"})
}
);
pubTime.before( $("br"), "Published " );
pubTime.after( " | Modified ", modTime, $("br") );
}
}
}
);