Yahoo T-Point Auto Skip

Automatically skips the T-Point / PayPay registration nag screen on Yahoo! Japan.

目前为 2023-10-22 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @author たかだか。/TKDK.
  3. // @name Yahoo T-Point Auto Skip
  4. // @name:ja Yahoo T-Point Auto Skip
  5. // @namespace https://twitter.com/djtkdk_086969
  6. // @description:ja Yahoo! Japan ログイン後の「T-POINT利用手続き/PayPay連携/LINEアカウント連携」画面を自動的にスキップします。
  7. // @description Automatically skips the T-Point / PayPay registration nag screen on Yahoo! Japan.
  8. // @include *://tcard.yahoo.co.jp/*
  9. // @include *://wallet.yahoo.co.jp/*
  10. // @include *://paypay.yahoo.co.jp/*
  11. // @include *://id.lylink.yahoo.co.jp/*
  12. // @version 0.2.2.005
  13. // @grant none
  14. // @license MIT License; https://opensource.org/licenses/mit-license.php
  15. // @homepage https://twitter.com/djtkdk_086969
  16. // @compatible firefox
  17. // @compatible chrome
  18. // ==/UserScript==
  19.  
  20. (function() {
  21. console.log("YTPAS: Started.");
  22. window.addEventListener ('DOMContentLoaded', checkElem());
  23.  
  24. var mo =
  25. new MutationObserver(function(mutationEventList) {
  26. checkElem();
  27. });
  28. var mo_conf = {
  29. childList: true,
  30. attributes: true,
  31. characterData: false,
  32. subtree: true
  33. };
  34. mo.observe(document.querySelector('body'), mo_conf);
  35.  
  36. function checkElem() {
  37. console.log("YTPAS: Checking elements...");
  38. let skipButtonT = document.getElementById("skipButton");
  39. let skipButtonP = document.getElementById("ppskip");
  40. if (skipButtonT !== null &&
  41. location.href.startsWith('https://tcard.yahoo.co.jp/') &&
  42. document.title.match(/[TT]ポイント利用手続き/) !== null) {
  43. console.log("YTPAS: T-Point nag screen detected. Skipping...");
  44. skipButtonT.click();
  45. }
  46. if (skipButtonP !== null &&
  47. (
  48. location.href.startsWith('https://wallet.yahoo.co.jp/paypay/agreement/') ||
  49. location.href.startsWith('https://paypay.yahoo.co.jp/agreement/')
  50. ) &&
  51. document.title.match(/ヤフーからの大切なお知らせです/) !== null) {
  52. console.log("YTPAS: PayPay nag screen detected. Skipping...");
  53. skipButtonP.click();
  54. }
  55. if (location.href.includes("id.lylink.yahoo.co.jp")) {
  56. // LINEアカウント連携
  57. let lyHeader = document.getElementsByTagName("h1");
  58. let lyFlag = false;
  59. if (lyHeader.length > 0) {
  60. [].slice.call(lyHeader).forEach( (e) => {
  61. if (e.innerText == "アカウント連携をしましょう") {
  62. lyFlag = true;
  63. }
  64. });
  65. }
  66. if (lyFlag) {
  67. console.log("YTPAS: LINE nag screen detected. Skipping...");
  68. let lyBtn = document.querySelectorAll("button.btn");
  69. if (lyBtn.length > 0) {
  70. [].slice.call(lyBtn).forEach( (e) => {
  71. if (e.innerText == "あとで行う") {
  72. e.click();
  73. }
  74. });
  75. }
  76. }
  77. }
  78. }
  79. })();