Skip to content

Commit

Permalink
Update main.html
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaN0X authored Dec 18, 2024
1 parent db7a5b6 commit 74c5753
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions main.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 74c5753

Please sign in to comment.