Vape V4

A browser script made to give enhancements on Miniblox

  1. // ==UserScript==
  2. // @name Vape V4
  3. // @namespace http://7granddadpgn.github.io
  4. // @version 3.0.6
  5. // @description A browser script made to give enhancements on Miniblox
  6. // @author 7GrandDad
  7. // @match https://miniblox.io/*
  8. // @match https://miniblox.org/*
  9. // @match https://miniblox.online/*
  10. // @match https://bloxbattles.io/*
  11. // @icon https://miniblox.io/favicon.png
  12. // @grant GM_getValue
  13. // @grant GM_setValue
  14. // @grant unsafeWindow
  15. // @require https://codeberg.org/RealPacket/VapeForMiniblox/raw/tag/3.0.6/injection.js#sha256=a50e0b233ad7b1a61f4cbbf352ac3ab07fd356e01fe8615c90755eb9ae51227e
  16. // @run-at document-start
  17. // ==/UserScript==
  18.  
  19. // would reuse this, but Codeberg doesn't have CORS headers so we can't use it.
  20. // this would fix the caching issues, but sadly CORS moment.
  21. /*
  22. (function() {
  23. 'use strict';
  24.  
  25. async function execute(url, oldScript) {
  26. if (oldScript) oldScript.type = 'javascript/blocked';
  27. let data = await fetch("https://raw.githubusercontent.com/7GrandDadPGN/VapeForMiniblox/main/injection.js").then(e => e.text());
  28. if (oldScript) oldScript.type = 'module';
  29. eval(data.replace("scripturl", url));
  30. }
  31.  
  32. // https://stackoverflow.com/questions/22141205/intercept-and-alter-a-sites-javascript-using-greasemonkey
  33. if(navigator.userAgent.indexOf("Firefox") != -1)
  34. {
  35. window.addEventListener("beforescriptexecute", function(e) {
  36. if(e.target.src.includes("https://miniblox.io/assets/index"))
  37. {
  38. e.preventDefault();
  39. e.stopPropagation();
  40. execute(e.target.src);
  41. }
  42. }, false);
  43. }
  44. else
  45. {
  46. new MutationObserver(async (mutations, observer) => {
  47. let oldScript = mutations
  48. .flatMap(e => [...e.addedNodes])
  49. .filter(e => e.tagName == 'SCRIPT')
  50. .find(e => e.src.includes("https://miniblox.io/assets/index"));
  51.  
  52. if (oldScript) {
  53. observer.disconnect();
  54. execute(oldScript.src, oldScript);
  55. }
  56. }).observe(document, {
  57. childList: true,
  58. subtree: true,
  59. });
  60. }
  61. })();
  62. */

QingJ © 2025

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