Skip Jump Page

Skip Jump Page.

  1. // ==UserScript==
  2. // @name Skip Jump Page
  3. // @description Skip Jump Page.
  4. // @version 0.6
  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. // @match https://*.studio.site/*
  20. // @match https://*.ffm.to/*
  21. // @match https://owlpop.co/*
  22. // @match https://album.link/*
  23. // @match https://linkcloud.mu/*
  24. // @match https://linkk.la/*
  25. // @match https://linktr.ee/*
  26. // @icon https://www.google.com/s2/favicons?sz=64&domain=spotify.com
  27. // ==/UserScript==
  28.  
  29. const SERVICE = 'spotify';
  30. // const SERVICE = 'apple';
  31.  
  32. function jump(){
  33. [
  34. '//a[contains(@href, "' + SERVICE + '")]',
  35. '//img[contains(@src, "' + SERVICE + '")]/ancestor::a',
  36. ].forEach(path => {
  37. let elm = $x(path);
  38.  
  39. console.log(elm);
  40. // 予約ページを避ける
  41. if(elm && !/accounts\.spotify/.test(elm.href)){
  42. // 適切なリンクが存在しないリンクの場合 クリックする
  43. elm.href?
  44. location.href = elm.href :
  45. elm.click();
  46. }
  47. });
  48. }
  49.  
  50. // 遅延されて生成される要素も考慮する
  51. jump();
  52. setTimeout(jump, 300);
  53.  
  54. function $x(path){
  55. return document.evaluate(
  56. path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
  57. }