移除弹窗和跳转

移除kakao弹窗和跳转

// ==UserScript==
// @name        移除弹窗和跳转
// @namespace   vurses
// @license     Mit
// @author      layenh
// @match       https://security-otp.kakaogames.com/*
// @grant       none
// @version     1.0
// @run-at      document-start
// @description 移除kakao弹窗和跳转
// ==/UserScript==


const originalCall = Function.prototype.call;
Function.prototype.call = function (...args) {
  if (this.name === "4528") {
    let temp = this.toString();
    temp.indexOf(`alert(B.$i18n.t("page.error.common"))`);
    console.log(temp.indexOf(`alert(B.$i18n.t("page.error.common"))`))
    // // 移除alert并直接return防止跳转
    temp = temp.replace(`alert(B.$i18n.t("page.error.common"))`,`console.log("hello world!")`);
    temp = temp.replace(`f.replace(I("/"))`,`console.log("code injected successful!")`);
    temp = eval("(" + temp + ")");
    return originalCall.apply(temp, args);
  }
  return originalCall.apply(this, args);
};