Shellshock/Shellshockers FPS Unlocker

CREDITS TO A3+++

  1. // ==UserScript==
  2. // @name Shellshock/Shellshockers FPS Unlocker
  3. // @version 0.1
  4. // @author Pluh
  5. // @description CREDITS TO A3+++
  6. // @match *://shellshock.io/*
  7. // @run-at document-start
  8. // @grant unsafeWindow
  9. // @namespace https://greasyfork.org/en/users/1236917-pluh
  10. // ==/UserScript==
  11. (function () {
  12. unsafeWindow.hookScene = function () {
  13. BABYLON.Scene = new Proxy(BABYLON.Scene, {
  14. construct: function (func, args) {
  15. const product = new func(...args);
  16. ["probesEnabled", "particlesEnabled", "texturesEnabled", "fogDisabled", "lightsEnabled", "postProcessesEnabled", "lensFlaresEnabled", "renderTargetsEnabled", "shadowsDisabled", "proceduralTexturesEnabled"].forEach(a => Object.defineProperty(product, a, {
  17. get: () => false
  18. }));
  19. return product;
  20. },
  21. })
  22. }
  23. unsafeWindow.XMLHttpRequest = class extends XMLHttpRequest {
  24. constructor() {
  25. super(...arguments)
  26. }
  27. open() {
  28. if (arguments[1] && arguments[1].includes("js/shellshock.js")) {
  29. this.scriptMatch = true;
  30. }
  31. super.open(...arguments);
  32. }
  33. get response() {
  34. if (this.scriptMatch) {
  35. let responseText = super.response;
  36. let match = responseText.match(/else console.log\(window\),"undefined"==typeof window\?(\w).BABYLON=(\w\(\w,\w,\w\)).(\w)=\w\(\w,\w,\w\)/);
  37. if (match) {
  38. responseText = responseText.replace(match[0], `else{${match[1]}.BABYLON=${match[2]};${match[3]}=${match[1]}.BABYLON,window.hookScene()}`);
  39. }
  40. return responseText;
  41. }
  42. return super.response;
  43. }
  44. };
  45. }())