影视网页标题清理

清除影视网页标题中“集”字后面的字符

当前为 2023-05-12 提交的版本,查看 最新版本

// ==UserScript==
// @name         影视网页标题清理
// @version      3
// @description  清除影视网页标题中“集”字后面的字符
// @author       ChatGPT
// @match        *://*/*
// @run-at       document-end
// @grant        none
// @namespace https://gf.qytechs.cn/users/452911
// ==/UserScript==

// 获取当前网页的标题
const pageTitle = document.title;

// 去除标题中的尖括号和其前面的字符
const newTitle = pageTitle.replace(/.*?[《](.*)/g, "$1").replace(/[《》]/g, "");

// 判断标题是否包含“集”字,如果包含则替换为最后一个出现的“集”
if (newTitle.includes('集')) {
  const lastIndex = newTitle.lastIndexOf('集');
  const finalTitle = newTitle.substring(0, lastIndex + 1);
  document.title = finalTitle;
} else {
  document.title = newTitle;
}

QingJ © 2025

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