Greasy Fork URL 脚本名称清理

清理 Greasy Fork URL 中的脚本名称

Verze ze dne 17. 09. 2021. Zobrazit nejnovější verzi.

  1. // ==UserScript==
  2. // @name Greasy Fork URL 脚本名称清理
  3. // @version 1.0.2.20210918
  4. // @namespace laster2800
  5. // @author Laster2800
  6. // @description 清理 Greasy Fork URL 中的脚本名称
  7. // @icon https://api.iowen.cn/favicon/greatest.deepsurf.us.png
  8. // @homepageURL https://greatest.deepsurf.us/zh-CN/scripts/431940
  9. // @supportURL https://greatest.deepsurf.us/zh-CN/scripts/431940/feedback
  10. // @license LGPL-3.0
  11. // @noframes
  12. // @include /^https?:\/\/(greasy|sleazy)fork\.org\/[^/]+\/scripts\/\d+-/
  13. // @grant none
  14. // @run-at document-start
  15. // ==/UserScript==
  16.  
  17. const m = /(\/[^/]+\/scripts\/\d+)-[^/]+(\/.*)?/.exec(location.pathname)
  18. history.replaceState({}, null, `${location.origin}${m[1]}${m[2] ?? ''}${location.search}${location.hash}`)