Skip to content

Commit

Permalink
Move to v7.2.4, fix racing features.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sashank999 committed Jun 20, 2024
1 parent 5df222e commit 9656832
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions extension/changelog.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[
{
"version": { "major": 7, "minor": 3, "build": 0 },
"version": { "major": 7, "minor": 2, "build": 4 },
"title": "Beta",
"date": false,
"logs": { "features": [], "fixes": [], "changes": [], "removed": [] }
"logs": { "features": [], "fixes": [{ "message": "Fixing racing features.", "contributor": "TheFoxMan" }], "changes": [], "removed": [] }
},
{
"version": { "major": 7, "minor": 2, "build": 3 },
Expand Down
4 changes: 2 additions & 2 deletions extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "TornTools",
"version": "7.3.0",
"version": "7.2.4",
"description": "Several tools for Torn.",
"icons": { "16": "resources/images/icon_16.png", "48": "resources/images/icon_48.png", "128": "resources/images/icon_128.png" },
"action": { "default_title": "TornTools", "default_popup": "pages/popup/popup.html", "default_icon": "resources/images/icon_128.png" },
Expand Down Expand Up @@ -609,7 +609,7 @@
"run_at": "document_end"
},
{
"matches": ["https://www.torn.com/loader.php?sid=racing*"],
"matches": ["https://www.torn.com/page.php?sid=racing*"],
"css": ["scripts/features/racing-upgrades/ttRacingUpgrades.css"],
"js": ["scripts/features/car-win-percentage/ttCarWinPercentage.js", "scripts/features/racing-upgrades/ttRacingUpgrades.js"],
"run_at": "document_end"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
addXHRListener(({ detail: { page, xhr } }) => {
if (
feature.enabled() &&
page === "loader" &&
page === "page" &&
(xhr.responseURL.includes("tab=parts") || xhr.responseURL.includes("tab=cars") || xhr.responseURL.includes("race_carlist.js"))
)
addPercentage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
addXHRListener(async ({ detail: { page, xhr, uri } }) => {
if (!feature.enabled()) return;

if (page === "loader" && uri) {
if (page === "page" && uri) {
const sid = uri.sid;
if (sid !== "racing") return;

Expand All @@ -33,7 +33,7 @@
car.classList.add("tt-modified");
car.addEventListener("click", () => requireElement(".pm-categories-wrap").then(showUpgrades));
}
} else if (page === "loader2") {
} else if (page === "page") {
const params = new URLSearchParams(xhr.requestBody);

const sid = params.get("sid");
Expand All @@ -45,7 +45,7 @@
const confirm = params.get("confirm");
if (confirm !== "1") return;

setTimeout(resetUpgrades, 250);
setTimeout(resetUpgrades, 1000);
}
});
}
Expand Down

0 comments on commit 9656832

Please sign in to comment.