Modify XHR Request URL

店八方翻译劫持脚本,将翻译api请求导向自定义服务器

  1. // ==UserScript==
  2. // @name Modify XHR Request URL
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.6
  5. // @description 店八方翻译劫持脚本,将翻译api请求导向自定义服务器
  6. // @author ShevonKwan
  7. // @match https://shopee.dianbafang.com/common_collect_box/items
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=shopee.dianbafang.com/
  9. // @grant GM_xmlhttpRequest
  10. // @license GPLv3
  11. // ==/UserScript==
  12.  
  13.  
  14.  
  15. (function () {
  16. var open = XMLHttpRequest.prototype.open;
  17. XMLHttpRequest.prototype.open = function (method, url, async, user, pass) {
  18. if (url === "https://shopee.dianbafang.com/api/move/common_collect_box/translateCommonBoxDetail") {
  19. var newUrl = "https://miaoshou-translate.vercel.app/api/index";
  20. var headers = arguments[5];
  21. headers = headers ? headers : {};
  22. headers["Referer"] = "https://erp.91miaoshou.com";
  23. arguments[5] = headers;
  24. open.call(this, method, newUrl, async, user, pass);
  25. } else {
  26. open.call(this, method, url, async, user, pass);
  27. }
  28. };
  29. })();
  30.  
  31.  
  32.  

QingJ © 2025

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