Zyxel Redirect Blocker

Blocks Zyxel redirecting to HTTPS

目前为 2025-04-13 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Zyxel Redirect Blocker
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0.0
  5. // @description Blocks Zyxel redirecting to HTTPS
  6. // @author JxxIT
  7. // @match http://192.168.0.1/*
  8. // @icon https://info.zyxel.com/hubfs/favicon.ico
  9. // @grant none
  10. // @run-at document-start
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. const originalOpen = window.XMLHttpRequest.prototype.open;
  18.  
  19. window.XMLHttpRequest.prototype.open = function(method, url, async, user, password) {
  20. this.addEventListener('load', function() {
  21. if (url.includes("getWebGuiFlag")) {
  22. try {
  23. const json = JSON.parse(this.responseText);
  24.  
  25. json.HTTP_Redirect_HTTPS = false;
  26. json.ABPY_GUI_Customization = false;
  27. json.ZYXEL_TT_CUSTOMIZATION = false;
  28.  
  29. const modifiedResponse = JSON.stringify(json);
  30.  
  31. Object.defineProperty(this, 'responseText', {
  32. value: modifiedResponse,
  33. writable: false,
  34. configurable: false,
  35. enumerable: false
  36. });
  37. } catch (error) {
  38. console.error('Error modifying response:', error);
  39. }
  40. }
  41. });
  42.  
  43. return originalOpen.apply(this, arguments);
  44. };
  45. })();