From 3bf7967a73c7e599ada623f0cbb6e8a025ebb820 Mon Sep 17 00:00:00 2001 From: Sashank999 Date: Mon, 17 Jun 2024 08:08:48 +0530 Subject: [PATCH] FF Gym Graph, OC NNB, Profile Spies not working. CSP issue only on Firefox, added `relay: true`. Also added a `requireSidebar()` to `ttGlobal.entry.js` to avoid an error. --- extension/changelog.json | 7 ++++++- extension/scripts/content/global/ttGlobal.entry.js | 1 + .../scripts/features/company-specials/ttCompanySpecials.js | 1 + extension/scripts/features/gym-graph/ttGymGraph.js | 2 +- extension/scripts/features/oc-nnb/ttOCNNB.js | 2 +- extension/scripts/features/profile-box/ttProfileBox.js | 2 +- 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/extension/changelog.json b/extension/changelog.json index 61e72f150..f3074096e 100644 --- a/extension/changelog.json +++ b/extension/changelog.json @@ -3,7 +3,12 @@ "version": { "major": 7, "minor": 3, "build": 0 }, "title": "Beta", "date": false, - "logs": { "features": [], "fixes": [], "changes": [], "removed": [] } + "logs": { + "features": [], + "fixes": [{ "message": "Fixed various TS features(Gym Graph, OC NNB, Profile Spies) not working.", "contributor": "TheFoxMan" }], + "changes": [], + "removed": [] + } }, { "version": { "major": 7, "minor": 2, "build": 2 }, diff --git a/extension/scripts/content/global/ttGlobal.entry.js b/extension/scripts/content/global/ttGlobal.entry.js index de7f3323b..f81826512 100644 --- a/extension/scripts/content/global/ttGlobal.entry.js +++ b/extension/scripts/content/global/ttGlobal.entry.js @@ -32,6 +32,7 @@ const countTimers = []; })(); async function forceUpdate() { + await requireSidebar(); await requireContent(); document.find("#sidebarroot ul[class*='status-icons']").setAttribute("updated", Date.now()); diff --git a/extension/scripts/features/company-specials/ttCompanySpecials.js b/extension/scripts/features/company-specials/ttCompanySpecials.js index 21085ef88..039c9a720 100644 --- a/extension/scripts/features/company-specials/ttCompanySpecials.js +++ b/extension/scripts/features/company-specials/ttCompanySpecials.js @@ -178,6 +178,7 @@ player_level: parseInt(json.result.user.level), ...data[user], }, + relay: true, }) .then((response) => { const responseElement = specialContext.find(".external-response"); diff --git a/extension/scripts/features/gym-graph/ttGymGraph.js b/extension/scripts/features/gym-graph/ttGymGraph.js index efda648a4..5674cc167 100644 --- a/extension/scripts/features/gym-graph/ttGymGraph.js +++ b/extension/scripts/features/gym-graph/ttGymGraph.js @@ -95,7 +95,7 @@ result = ttCache.get("gym", "graph"); } else { try { - result = await fetchData(FETCH_PLATFORMS.tornstats, { section: "battlestats/graph" }); + result = await fetchData(FETCH_PLATFORMS.tornstats, { section: "battlestats/graph", relay: true }); if (result.status) { ttCache.set({ graph: result }, TO_MILLIS.HOURS, "gym").then(() => {}); diff --git a/extension/scripts/features/oc-nnb/ttOCNNB.js b/extension/scripts/features/oc-nnb/ttOCNNB.js index 606bfaa95..1409d0b33 100644 --- a/extension/scripts/features/oc-nnb/ttOCNNB.js +++ b/extension/scripts/features/oc-nnb/ttOCNNB.js @@ -59,7 +59,7 @@ result = ttCache.get("crimes", "tornstats"); } else { try { - result = await fetchData(FETCH_PLATFORMS.tornstats, { section: "faction/crimes" }); + result = await fetchData(FETCH_PLATFORMS.tornstats, { section: "faction/crimes", relay: true }); if (result.status) { ttCache.set({ tornstats: result }, TO_MILLIS.HOURS, "crimes").then(() => {}); diff --git a/extension/scripts/features/profile-box/ttProfileBox.js b/extension/scripts/features/profile-box/ttProfileBox.js index 9aa291514..89ba534e0 100644 --- a/extension/scripts/features/profile-box/ttProfileBox.js +++ b/extension/scripts/features/profile-box/ttProfileBox.js @@ -638,7 +638,7 @@ result = ttCache.get("tornstats-spy", id); isCached = true; } else { - result = await fetchData(FETCH_PLATFORMS.tornstats, { section: "spy/user", id, silent: true }); + result = await fetchData(FETCH_PLATFORMS.tornstats, { section: "spy/user", id, silent: true, relay: true }); result = { status: result.status,