From 74c5753337970b206c2d91175974ed48df13d7f4 Mon Sep 17 00:00:00 2001 From: SeaN0X <69431500+SeaN0X@users.noreply.github.com> Date: Wed, 18 Dec 2024 06:28:37 -0400 Subject: [PATCH] Update main.html --- main.html | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/main.html b/main.html index fe0a6e1..e5c37dd 100644 --- a/main.html +++ b/main.html @@ -44,6 +44,38 @@ const game = params.get("game"); console.log('2'); + +var definition; + +// hook necessário para direcionar as chamadas das dependencias dos jogos +const old_fetch = fetch +fetch = function(arg1,arg2={}){ + + console.log(arg1) + var new_url = arg1.url.toString() + + if(arg1.url.match(".xml")){ + / + const file_xml_name = arg1.url.match(/([^\/]+\.xml)$/g)[0] + console.log(file_xml_name) + + new_url= "https://sean0x.github.io/games/"+game+"/xml/"+file_xml_name + console.log("formatted: "+new_url) + } else + if(arg1.url.match(".swf")){ + + const file_swf_name = arg1.url.match(/([^\/]+\.swf)$/g)[0] + console.log(file_swf_name) + + new_url= "https://sean0x.github.io/games/"+game+"/swfs/"+file_swf_name + console.log("formatted: "+new_url) + + } + return old_fetch(new_url,arg2) + +} + + let game_exists = false; try {