Northie / 旧版河畔去除水印

// ==UserScript==
// @name         旧版河畔去除水印
// @namespace    https://openuserjs.org/users/Northie
// @version      2026.08.26
// @description  隐藏旧版河畔由 Canvas 生成的 UID 平铺水印
// @author       Northie
// @copyright    2026, Northie (https://openuserjs.org/users/Northie)
// @license      GPL-3.0-or-later; https://www.gnu.org/licenses/gpl-3.0.txt
// @homepageURL  https://github.com/WhyPilotXia/Crack-SVG-watermark-for-bbs.uestc.edu.cn
// @supportURL   https://github.com/WhyPilotXia/Crack-SVG-watermark-for-bbs.uestc.edu.cn/issues
// @match        https://bbs.uestc.edu.cn/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

// ==OpenUserJS==
// @author       Northie
// ==/OpenUserJS==

(function () {
  'use strict'

  const STYLE_ID = 'tm-qshp-hide-watermark'
  const WATERMARK_SELECTORS = [
    'body > div[style*="position: fixed"][style*="pointer-events: none"][style*="data:image/png;base64"]',
    'body > div[style*="position:fixed"][style*="pointer-events:none"][style*="data:image/png;base64"]',
    'body > div[style*="position: fixed"][style*="pointer-events: none"][style*="data:image/svg+xml"]',
    'body > div[style*="position:fixed"][style*="pointer-events:none"][style*="data:image/svg+xml"]'
  ].join(',\n')

  function installWatermarkRule() {
    if (document.getElementById(STYLE_ID)) return

    const style = document.createElement('style')
    style.id = STYLE_ID
    style.textContent = `${WATERMARK_SELECTORS} {
      display: none !important;
      background: none !important;
    }`

    ;(document.head || document.documentElement).appendChild(style)
  }

  if (document.documentElement) {
    installWatermarkRule()
    return
  }

  const observer = new MutationObserver(() => {
    if (!document.documentElement) return
    observer.disconnect()
    installWatermarkRule()
  })

  observer.observe(document, { childList: true })
})()