Wiki2wand

Redirect Wikipedia to Wikiwand.

  1. // ==UserScript==
  2. // @name Wiki2wand
  3. // @version 1.2
  4. // @run-at document-start
  5. // @description Redirect Wikipedia to Wikiwand.
  6. // @include http://*.wikipedia.org/wiki/*
  7. // @include https://*.wikipedia.org/wiki/*
  8. // @include http://*.wiktionary.org/wiki/*
  9. // @include https://*.wiktionary.org/wiki/*
  10. // @include http://*.wikiquote.org/wiki/*
  11. // @include https://*.wikiquote.org/wiki/*
  12. // @exclude http://*.wikipedia.org/wiki/*?oldformat=true
  13. // @exclude https://*.wikipedia.org/wiki/*?oldformat=true
  14. // @exclude http://*.wiktionary.org/wiki/*?oldformat=true
  15. // @exclude https://*.wiktionary.org/wiki/*?oldformat=true
  16. // @exclude http://*.wikiquote.org/wiki/*?oldformat=true
  17. // @exclude https://*.wikiquote.org/wiki/*?oldformat=true
  18. // @author ylusid
  19. // @namespace https://gf.qytechs.cn/en/users/1355994-ylusid
  20. // @grant none
  21. // @license MIT
  22. // ==/UserScript==
  23.  
  24. var theurl = document.URL;
  25. var parser = /^https?:\/\/(\w+)\.(m\.)?(\w+)\.org\/wiki\/([^\?#]+)(\?[^#]+)?(#.+)?/;
  26.  
  27. domain = theurl.match(parser)[3];
  28. var wikiwand_app = "articles";
  29. if (domain == "wiktionary") {
  30. wikiwand_app = "dictionary";
  31. } else if (domain == "wikiquote") {
  32. wikiwand_app = "quotes";
  33. }
  34.  
  35. window.location.replace(theurl.replace(parser, 'https://www.wikiwand.com/$1/' + wikiwand_app + '/$4$6'))

QingJ © 2025

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