From f4d4000501f00b3222237fa0aaf15f619d4cd347 Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Tue, 16 Dec 2025 23:47:22 +0100 Subject: [PATCH 1/3] Fix wiki board info --- src/js/tabs/firmware_flasher.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/js/tabs/firmware_flasher.js b/src/js/tabs/firmware_flasher.js index 01f7a50b894..cf1f0ae4c6e 100644 --- a/src/js/tabs/firmware_flasher.js +++ b/src/js/tabs/firmware_flasher.js @@ -9,7 +9,6 @@ import { tracking } from "../Analytics"; import PortHandler from "../port_handler"; import { gui_log } from "../gui_log"; import semver from "semver"; -import { urlExists } from "../utils/common"; import read_hex_file from "../workers/hex_parser.js"; import Sponsor from "../Sponsor"; import FileSystem from "../FileSystem"; @@ -1283,11 +1282,13 @@ firmware_flasher.initialize = async function (callback) { const targetSupportInfo = $("#targetSupportInfoUrl"); targetSupportInfo.on("click", function () { - let urlSupport = "https://betaflight.com/docs/wiki/boards/archive/Missing"; // general board missing - const urlBoard = `https://betaflight.com/docs/wiki/boards/current/${self.selectedBoard}`; // board description - if (urlExists(urlBoard)) { - urlSupport = urlBoard; - } + const baseBoardUrl = "https://betaflight.com/docs/wiki/boards/current"; + const hasBoardSelection = self?.selectedBoard !== "0"; + + const urlSupport = hasBoardSelection + ? `${baseBoardUrl}/${encodeURIComponent(self.selectedBoard)}` // selected board description + : "https://betaflight.com/docs/wiki/boards/archive/Missing"; // general board missing + targetSupportInfo.attr("href", urlSupport); }); From c064146cbe09840554e15cd1ac5def0765a99236 Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Tue, 16 Dec 2025 23:54:03 +0100 Subject: [PATCH 2/3] Remove urlExist utility --- src/js/utils/common.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/js/utils/common.js b/src/js/utils/common.js index 51798f9ca70..c967605ee9e 100644 --- a/src/js/utils/common.js +++ b/src/js/utils/common.js @@ -46,14 +46,6 @@ export function getTextWidth(text) { return Math.ceil(context.measureText(text).width); } -export function urlExists(url) { - let http = new XMLHttpRequest(); - - http.open("HEAD", url, false); - http.send(); - return http.status !== 404; -} - /** * Returns jquery sorted option list with optional value staying on top of the list. * From e88b869248fd7b08113f7ecfff5f6ecc6160078b Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Wed, 17 Dec 2025 00:00:48 +0100 Subject: [PATCH 3/3] Wanted to avoid --- src/js/tabs/firmware_flasher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/tabs/firmware_flasher.js b/src/js/tabs/firmware_flasher.js index cf1f0ae4c6e..143cb04e312 100644 --- a/src/js/tabs/firmware_flasher.js +++ b/src/js/tabs/firmware_flasher.js @@ -1283,7 +1283,7 @@ firmware_flasher.initialize = async function (callback) { targetSupportInfo.on("click", function () { const baseBoardUrl = "https://betaflight.com/docs/wiki/boards/current"; - const hasBoardSelection = self?.selectedBoard !== "0"; + const hasBoardSelection = self.selectedBoard && self.selectedBoard !== "0"; const urlSupport = hasBoardSelection ? `${baseBoardUrl}/${encodeURIComponent(self.selectedBoard)}` // selected board description