From a76a44e1b81a9142bdb196e9fcd2ccb77d40cd29 Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Mon, 31 Aug 2020 11:06:27 -0600 Subject: [PATCH] Fuck it, I guess let anyone use the secret query args --- js/main.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/js/main.js b/js/main.js index 5e7c36b..724ee6d 100644 --- a/js/main.js +++ b/js/main.js @@ -1053,13 +1053,7 @@ class Game { } async function main() { - let query; - if (location.host.match(/localhost/)) { - query = new URLSearchParams(location.search); - } - else { - query = new URLSearchParams; - } + let query = new URLSearchParams(location.search); // Pick a tileset // These alternative ones only exist locally for me at the moment, since @@ -1093,8 +1087,8 @@ async function main() { // Pick a level (set) // TODO error handling :( let stored_game; - if (query.get('setpath')) { - let path = query.get('setpath'); + let path = query.get('setpath'); + if (path && path.match(/^levels[/]/)) { let data = await fetch(path); if (path.match(/\.(?:dat|ccl)$/i)) { stored_game = dat.parse_game(data);