// Backup Keyboard Cheat Sheet // version 2024.4.5 // https://forum.vivaldi.net/post/745999 // Writes the contents of the keyboard cheat sheet to your clipboard in markdown // format. Open keyboard cheat sheet popup, open user interface console, paste // code and hit Enter to execute. const sheet = document.querySelector(".keyboardShortcutsWrapper"); const heading = sheet.querySelector("h1").innerText; const pb1 = "\n\n"; const pb2 = `
`; let output = `${pb1}# ${heading}\n\n\n`; sheet.querySelectorAll(".category").forEach((category, key, arr) => { const caps = category.firstChild.innerText.toUpperCase(); output += ` \n`; category.querySelectorAll(".keycombo").forEach((command) => { output += ` \n"; else output += "
"; }); }); if (Object.is(arr.length - 1, key)) output += "
${caps}${pb2}
${command.innerText}`; command.querySelectorAll("input").forEach((combo, key, arr) => { output += combo.value; if (Object.is(arr.length - 1, key)) output += "
"; else output += "   \n"; }); copy(output); console.info(output);