HCBBS Fix

Fix functions such as deteting and editing posts of HCBBS.

  1. // ==UserScript==
  2. // @name HCBBS Fix
  3. // @namespace https://scriptcat.org/
  4. // @version 1
  5. // @description Fix functions such as deteting and editing posts of HCBBS.
  6. // @author firetree
  7. // @match https://hcbbs.eu.org/*
  8. // @require https://scriptcat.org/lib/513/2.0.0/ElementGetter.js#sha256=KbLWud5OMbbXZHRoU/GLVgvIgeosObRYkDEbE/YanRU=
  9. // @grant none
  10. // @license cc0
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. elmGetter.each('[href]', document, (/**@type {HTMLElement}*/el) => {
  16. el.setAttribute('href', el.getAttribute('href').replace(/^\? (.*)$/, `?$1`))
  17. });
  18. elmGetter.each('[data-href]', document, (/**@type {HTMLElement}*/el) => {
  19. el.dataset.href = el.dataset.href.replace(/^\? (.*)$/, `?$1`)
  20. });
  21. })();