Skip Jump Page

Skip Jump Page.

当前为 2022-05-05 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Skip Jump Page
  3. // @description Skip Jump Page.
  4. // @version 0.5
  5. // @namespace https://github.com/to
  6. // @author to
  7. // @license MIT
  8. //
  9. // @match https://songwhip.com/*
  10. // @match https://linkco.re/*
  11. // @match https://*.lnk.to/*
  12. // @match https://big-up.style/*
  13. // @match https://orcd.co/*
  14. // @match https://nex-tone.link/*
  15. // @match https://*.landr.com/*
  16. // @match https://song.link/*
  17. // @match https://ffm.to/*
  18. // @match https://fanlink.to/*
  19. // @icon https://www.google.com/s2/favicons?sz=64&domain=spotify.com
  20. // ==/UserScript==
  21.  
  22. [
  23. '//a[contains(@href, "spotify")]',
  24. '//img[contains(@src, "spotify")]/ancestor::a',
  25. ].forEach(path => {
  26. let elm = $x(path);
  27.  
  28. console.log(elm);
  29. // 予約ページを避ける
  30. if(elm && !/accounts\.spotify/.test(elm.href)){
  31. // 適切なリンクが存在しないリンクの場合 クリックする
  32. elm.href?
  33. location.href = elm.href :
  34. elm.click();
  35. }
  36. });
  37.  
  38. function $x(path){
  39. return document.evaluate(
  40. path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
  41. }