IGG-Games show last edit date

Show the last edit date of the game on IGG-Games

当前为 2023-06-08 提交的版本,查看 最新版本

// ==UserScript==
// @name         IGG-Games show last edit date
// @namespace    https://github.com/Alistair1231/my-userscripts/
// @version      0.0.3
// @description  Show the last edit date of the game on IGG-Games
// @author       Alistair1231
// @icon         https://icons.duckduckgo.com/ip2/igg-games.com.ico
// @grant        none
// @match        https://igg-games.com/*
// @license MIT
// ==/UserScript==

(async function() {

function tryGetDate() {
    return new Promise((resolve, reject) => {
      const preDate = document.querySelector("article meta[property*='date']");
      if (preDate === null) {
        setTimeout(tryGetDate, 500);
      } else {
        resolve(preDate);
      }
    });
  }

preDate= await tryGetDate()

dateString = new Date(preDate.content).toLocaleDateString("en-US", {
year: "numeric",
month: "long",
day: "numeric"
});


document.querySelector("p time").append(
` (last update ${dateString})`
)
  // Your code here...
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址