Skip to content

Commit

Permalink
FF Gym Graph, OC NNB, Profile Spies not working.
Browse files Browse the repository at this point in the history
CSP issue only on Firefox, added `relay: true`.
Also added a `requireSidebar()` to `ttGlobal.entry.js` to avoid an
error.
  • Loading branch information
Sashank999 committed Jun 17, 2024
1 parent d3d8900 commit 3bf7967
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
7 changes: 6 additions & 1 deletion extension/changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
1 change: 1 addition & 0 deletions extension/scripts/content/global/ttGlobal.entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const countTimers = [];
})();

async function forceUpdate() {
await requireSidebar();
await requireContent();

document.find("#sidebarroot ul[class*='status-icons']").setAttribute("updated", Date.now());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
player_level: parseInt(json.result.user.level),
...data[user],
},
relay: true,
})
.then((response) => {
const responseElement = specialContext.find(".external-response");
Expand Down
2 changes: 1 addition & 1 deletion extension/scripts/features/gym-graph/ttGymGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {});
Expand Down
2 changes: 1 addition & 1 deletion extension/scripts/features/oc-nnb/ttOCNNB.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {});
Expand Down
2 changes: 1 addition & 1 deletion extension/scripts/features/profile-box/ttProfileBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3bf7967

Please sign in to comment.