Skip to content

Instantly share code, notes, and snippets.

@webartoli
Last active February 19, 2025 10:09
Show Gist options
  • Save webartoli/7b3d8ee027f6ce19bf09545e6f1b7f4c to your computer and use it in GitHub Desktop.
Save webartoli/7b3d8ee027f6ce19bf09545e6f1b7f4c to your computer and use it in GitHub Desktop.
Dailytoast.io key handler
// paste this snippet in your browser bookmark url
javascript: (function () {
function clickIfVisible(selector) {
var element = document.querySelector(selector);
if (element && element.offsetParent !== null) {
element.click();
return true;
}
return false;
}
function turnOffVolume() {
clickIfVisible('button:has(span[class^="icon-soundon"])');
}
function setTimePerPartecipant() {
clickIfVisible("button.button-icon_up");
}
function registerKeys() {
document.addEventListener("keydown", function (event) {
switch (event.key) {
case "ArrowRight":
clickIfVisible("button.button-next");
break;
case " ": // spacebar
clickIfVisible("app-button[label='RESUME'] button") ||
clickIfVisible("button.button-pause") ||
clickIfVisible("button.button_primary");
break;
default:
break;
}
});
}
turnOffVolume();
setTimePerPartecipant();
registerKeys();
})();
@webartoli
Copy link
Author

Behaviour:

  • Press spacebar to start, pause and resume
  • Press Arrow Right to next partecipant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment