From 9d6a39883c0cee7de74574e3ae4947ea63f5eb75 Mon Sep 17 00:00:00 2001 From: Kara Date: Tue, 12 Sep 2023 02:56:24 -0500 Subject: [PATCH] firefox debugger --- .vscode/launch.json | 16 ++++++++++++++++ scripts/sidebar.js | 3 +++ 2 files changed, 19 insertions(+) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..12cc95a95 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch localhost", + "type": "firefox", + "request": "launch", + "reAttach": true, + "url": "http://localhost:3000/index.html", + "webRoot": "${workspaceFolder}/book" + }, + ] +} \ No newline at end of file diff --git a/scripts/sidebar.js b/scripts/sidebar.js index 1c821ef25..5f1352cdf 100644 --- a/scripts/sidebar.js +++ b/scripts/sidebar.js @@ -22,6 +22,9 @@ var updateFunction = function() { el.classList.remove("active"); }); + if (id == undefined) + return; + Array.prototype.forEach.call(document.getElementsByClassName("pagetoc")[0].children, function(el) { if (id.href.localeCompare(el.href) == 0) { el.classList.add("active");