Skip to content

Instantly share code, notes, and snippets.

@harmoniemand
Last active May 27, 2021 14:24
Show Gist options
  • Save harmoniemand/20b9786369c79fef3a0f5591ca59783e to your computer and use it in GitHub Desktop.
Save harmoniemand/20b9786369c79fef3a0f5591ca59783e to your computer and use it in GitHub Desktop.
Jufo-Bundeswettbewerb-Arrow-Operation
// Greasemonkey Script für die Jugendforscht PLattform 2021
// Plugin: https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
// ==UserScript==
// @name Jufo-Bundeswettbewerb-Arrow-Operation
// @version 1
// @grant none
// ==/UserScript==
window.addEventListener("keydown", event => {
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const projectId = urlParams.get('bid')
if (event.isComposing || event.keyCode === 37) {
// previous
window.location.href = "https://jufo-buwe-event.experimenta.science/x/21/event.php?pg=messehalle&h=1&bid=" + (Number(projectId) - 1);
return;
}
if (event.isComposing || event.keyCode === 39) {
//next
window.location.href = "https://jufo-buwe-event.experimenta.science/x/21/event.php?pg=messehalle&h=1&bid=" + (Number(projectId) + 1);
return;
}
});
//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment