From dffcfd6891afa95c7f7370f8d34b9a77bb05403d Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Sat, 7 Aug 2021 18:45:21 -0300 Subject: [PATCH] Revert "workaround by using .mjs" This reverts commit d07b64e8d90d778e25b7dfe2a53d0a12dcab8580. --- src/main/resources/web/index.html | 2 +- .../web/js/{account_manager.mjs => account_manager.js} | 8 ++++---- .../resources/web/js/{cors_proxy.mjs => cors_proxy.js} | 2 +- .../web/js/{notification.mjs => notification.js} | 0 src/main/resources/web/js/{page.mjs => page.js} | 10 +++++----- src/main/resources/web/js/{util.mjs => util.js} | 4 ++-- .../resources/web/js/{websocket.mjs => websocket.js} | 10 +++++----- 7 files changed, 18 insertions(+), 18 deletions(-) rename src/main/resources/web/js/{account_manager.mjs => account_manager.js} (98%) rename src/main/resources/web/js/{cors_proxy.mjs => cors_proxy.js} (86%) rename src/main/resources/web/js/{notification.mjs => notification.js} (100%) rename src/main/resources/web/js/{page.mjs => page.js} (96%) rename src/main/resources/web/js/{util.mjs => util.js} (93%) rename src/main/resources/web/js/{websocket.mjs => websocket.js} (95%) diff --git a/src/main/resources/web/index.html b/src/main/resources/web/index.html index d155667..ae89f3f 100644 --- a/src/main/resources/web/index.html +++ b/src/main/resources/web/index.html @@ -172,6 +172,6 @@ script-src 'self' https://*.cloudflare.com/ https://alcdn.msauth.net/ https://*. - + diff --git a/src/main/resources/web/js/account_manager.mjs b/src/main/resources/web/js/account_manager.js similarity index 98% rename from src/main/resources/web/js/account_manager.mjs rename to src/main/resources/web/js/account_manager.js index 5587598..1b8ed39 100644 --- a/src/main/resources/web/js/account_manager.mjs +++ b/src/main/resources/web/js/account_manager.js @@ -1,6 +1,6 @@ -import {getCorsProxy} from "./cors_proxy.mjs"; -import {checkFetchSuccess, filterNot, isSuccess} from "./util.mjs"; -import {addToast, refreshAccountList} from "./page.mjs"; +import {getCorsProxy} from "./cors_proxy.js"; +import {checkFetchSuccess, filterNot, isSuccess} from "./util.js"; +import {addToast, refreshAccountList} from "./page.js"; let activeAccounts = []; @@ -301,4 +301,4 @@ function getTokenPopup(username, request) { console.warn(error); } }); -} +} \ No newline at end of file diff --git a/src/main/resources/web/js/cors_proxy.mjs b/src/main/resources/web/js/cors_proxy.js similarity index 86% rename from src/main/resources/web/js/cors_proxy.mjs rename to src/main/resources/web/js/cors_proxy.js index a2bb2ee..f32552e 100644 --- a/src/main/resources/web/js/cors_proxy.mjs +++ b/src/main/resources/web/js/cors_proxy.js @@ -1,4 +1,4 @@ -import {refreshCorsStatus} from "./page.mjs"; +import {refreshCorsStatus} from "./page.js"; function defaultCors() { return "https://crp123-cors.herokuapp.com/"; diff --git a/src/main/resources/web/js/notification.mjs b/src/main/resources/web/js/notification.js similarity index 100% rename from src/main/resources/web/js/notification.mjs rename to src/main/resources/web/js/notification.js diff --git a/src/main/resources/web/js/page.mjs b/src/main/resources/web/js/page.js similarity index 96% rename from src/main/resources/web/js/page.mjs rename to src/main/resources/web/js/page.js index d7be006..be5cc98 100644 --- a/src/main/resources/web/js/page.mjs +++ b/src/main/resources/web/js/page.js @@ -1,6 +1,6 @@ // Minecraft.id -import {icanhazepoch, icanhazip} from "./util.mjs"; -import {getCorsProxy, setCorsProxy} from "./cors_proxy.mjs"; +import {icanhazepoch, icanhazip} from "./util.js"; +import {getCorsProxy, setCorsProxy} from "./cors_proxy.js"; import { findAccountByMs, getActiveAccounts, @@ -8,8 +8,8 @@ import { loginMc, loginMs, MicrosoftAccount, MojangAccount -} from "./account_manager.mjs"; -import {connect, getWsUrl, removeToken, sendSocket, setWsUrl, unlisten} from "./websocket.mjs"; +} from "./account_manager.js"; +import {connect, getWsUrl, removeToken, sendSocket, setWsUrl, unlisten} from "./websocket.js"; let mcIdUsername = null; let mcauth_code = null; @@ -78,7 +78,7 @@ function swCacheFiles() { action: "cache", urls: performance.getEntriesByType("resource") .map(it => it.name) - .filter(it => it.endsWith(".mjs") || it.endsWith(".js") || it.endsWith(".css") || it.endsWith(".png")) + .filter(it => it.endsWith(".js") || it.endsWith(".css") || it.endsWith(".png")) })); // https://stackoverflow.com/questions/46830493/is-there-any-way-to-cache-all-files-of-defined-folder-path-in-service-worker } diff --git a/src/main/resources/web/js/util.mjs b/src/main/resources/web/js/util.js similarity index 93% rename from src/main/resources/web/js/util.mjs rename to src/main/resources/web/js/util.js index 47a1bf9..b58930c 100644 --- a/src/main/resources/web/js/util.mjs +++ b/src/main/resources/web/js/util.js @@ -1,4 +1,4 @@ -import {getCorsProxy} from "./cors_proxy.mjs"; +import {getCorsProxy} from "./cors_proxy.js"; export function isSuccess(status) { return status >= 200 && status < 300; @@ -27,4 +27,4 @@ export function icanhazepoch() { export function filterNot(array, item) { return array.filter(it => it !== item); -} +} \ No newline at end of file diff --git a/src/main/resources/web/js/websocket.mjs b/src/main/resources/web/js/websocket.js similarity index 95% rename from src/main/resources/web/js/websocket.mjs rename to src/main/resources/web/js/websocket.js index 965c9f2..fca033d 100644 --- a/src/main/resources/web/js/websocket.mjs +++ b/src/main/resources/web/js/websocket.js @@ -1,7 +1,7 @@ -import {authNotification} from "./notification.mjs"; -import {checkFetchSuccess} from "./util.mjs"; -import {findAccountByMcName} from "./account_manager.mjs"; -import {addListeningList, addToast, renderActions, resetHtml, setListenVisible, setWsStatus} from "./page.mjs"; +import {authNotification} from "./notification.js"; +import {checkFetchSuccess} from "./util.js"; +import {findAccountByMcName} from "./account_manager.js"; +import {addListeningList, addToast, renderActions, resetHtml, setListenVisible, setWsStatus} from "./page.js"; let wsUrl = getWsUrl(); let socket = null; @@ -135,4 +135,4 @@ export function sendSocket(msg) { return } socket.send(msg); -} +} \ No newline at end of file