Advertisement
Golden-ifpass

Disable Focus Reload (Manyland) - Paste into bookmark!

Apr 1st, 2020
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Disable Focus Reload by MTP3!*/
  2.  
  3. /*
  4.     Usage:
  5.     1. Make a new bookmark
  6.     2. Paste this code into the URL field:
  7.         javascript:$.getScript('https://pastebin.com/raw/zdeKe6dV');
  8.     3. Click, you should hear a success bling!
  9.     4. ???
  10.     5. Profit
  11. */
  12.  
  13. var mlCode = ""; /* Stores all of Manyland's JS for future variable name extraction. */
  14. var focusReload;
  15.  
  16. var getMLcode = function () { /* Get Manyland's code! */
  17.     return new Promise((res, rej) => {
  18.         a = $.get("manyland.js?v=" + v), a.always(function() { /* JQuery that code! */
  19.             mlCode = a.responseText; /* Store it too! */
  20.             res(); /* Resolve. */
  21.         });
  22.     });
  23. };
  24.  
  25. var findFind = (begin, end) => { /* Find the text between 2 literal strings */
  26.     var pos1 = mlCode.indexOf(begin) + begin.length;
  27.     var pos2 = mlCode.indexOf(end, pos1);
  28.  
  29.     return mlCode.substring(pos1, pos2);
  30. };
  31.  
  32. (async () => {
  33.     await getMLcode(); /* Wait until we've dumped the code. */
  34.  
  35.     /* Find an obfuscated variable name that we're required to use. */
  36.  
  37.     focusReload = findFind(
  38.         "&&ig.game.writableDialog.close()}catch(a){}},",
  39.         ":function(){if(!ig.game."
  40.     );
  41.  
  42.     /* Helpfully tell you what it currently is! */
  43.  
  44.     consoleref.log("ig.game.errorManager[focusReload] = ig.game.errorManager." + focusReload);
  45.  
  46.     /* Destroy the code! Makes you not reload upon Alt+Tabbing in the air. */
  47.  
  48.     ig.game.errorManager[focusReload] = () => {};
  49.  
  50.     ig.game.sounds.success.play();
  51. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement