Guest User

Untitled

a guest
Aug 4th, 2026
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Feuerwache.net 411 Fix XMLHttpRequest
  3. // @namespace Feuerwache.net
  4. // @version 8.0
  5. // @description Behebt leere POST Requests direkt am Browser-Transport
  6. // @match https://www.feuerwache.net/*
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. (function () {
  11. 'use strict';
  12.  
  13.  
  14. function status(text) {
  15.  
  16. let box =
  17. document.getElementById("fw411-status");
  18.  
  19. if (!box) {
  20. box = document.createElement("div");
  21. box.id = "fw411-status";
  22.  
  23. box.style.position = "fixed";
  24. box.style.top = "10px";
  25. box.style.right = "10px";
  26. box.style.background = "green";
  27. box.style.color = "white";
  28. box.style.padding = "8px";
  29. box.style.zIndex = "999999";
  30.  
  31. document.body.appendChild(box);
  32. }
  33.  
  34. box.innerHTML = text;
  35. }
  36.  
  37.  
  38. status("🔥 Feuerwache 411 Fix 8.0 aktiv");
  39.  
  40.  
  41. const oldSend =
  42. XMLHttpRequest.prototype.send;
  43.  
  44.  
  45. XMLHttpRequest.prototype.send =
  46. function(body) {
  47.  
  48.  
  49. let url =
  50. this._fw_url || "";
  51.  
  52.  
  53. if (
  54. this._fw_method === "POST" &&
  55. (!body || body === "")
  56. ) {
  57.  
  58. console.log(
  59. "411 Fix aktiv:",
  60. url
  61. );
  62.  
  63.  
  64. status(
  65. "🔧 Leerer POST repariert"
  66. );
  67.  
  68.  
  69. body =
  70. "fix=1";
  71. }
  72.  
  73.  
  74. return oldSend.call(
  75. this,
  76. body
  77. );
  78.  
  79. };
  80.  
  81.  
  82. const oldOpen =
  83. XMLHttpRequest.prototype.open;
  84.  
  85.  
  86. XMLHttpRequest.prototype.open =
  87. function(method,url) {
  88.  
  89.  
  90. this._fw_method =
  91. method.toUpperCase();
  92.  
  93. this._fw_url =
  94. url;
  95.  
  96.  
  97. return oldOpen.apply(
  98. this,
  99. arguments
  100. );
  101.  
  102. };
  103.  
  104.  
  105. })();
Advertisement
Add Comment
Please, Sign In to add comment