diff --git a/src/js/tabs/firmware_flasher.js b/src/js/tabs/firmware_flasher.js index 01f7a50b89..143cb04e31 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 && 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); }); diff --git a/src/js/utils/common.js b/src/js/utils/common.js index 51798f9ca7..c967605ee9 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. *