Skip to content

Instantly share code, notes, and snippets.

@oSumAtrIX
Last active April 13, 2024 12:41
Show Gist options
  • Save oSumAtrIX/94d79f87e413f1a79d8b15ecd083e5a6 to your computer and use it in GitHub Desktop.
Save oSumAtrIX/94d79f87e413f1a79d8b15ecd083e5a6 to your computer and use it in GitHub Desktop.
Tampermonkey script for osum!direct web functionality
// ==UserScript==
// @name osum!direct-web
// @version 1.4
// @description Modify the direct beatmap download button on the osu! site to support the custom osu protocol handler without osu!supporter
// @author oSumAtrIX
// @include https://osu.ppy.sh/*
// ==/UserScript==
(() => {
'use strict';
let button;
let interval = setInterval(() => {
if (!location.pathname.includes('/beatmapsets/') || (button = document.querySelector("div.beatmapset-header__buttons > a[href*=support]")) == null) return;
button.querySelector("span > span.btn-osu-big__left > span").innerText = 'osum!direct';
button.attributes.href.value = "osu://dl/" + location.pathname.split('/')[2]
}, 500);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment