Greasy Fork URL 脚本名称清理

清理 Greasy Fork URL 中的脚本名称

当前为 2021-09-17 提交的版本,查看 最新版本

  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/greasyfork.org.png
  8. // @homepageURL https://greasyfork.org/zh-CN/scripts/431940
  9. // @supportURL https://greasyfork.org/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}`)