Skip to content

Instantly share code, notes, and snippets.

@eggplants
Forked from KOBA789/bunkai-kei.js
Last active November 7, 2021 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eggplants/8d280e079ecd7bdda21f34cd99b5fd76 to your computer and use it in GitHub Desktop.
Save eggplants/8d280e079ecd7bdda21f34cd99b5fd76 to your computer and use it in GitHub Desktop.
http://bunkai-kei.com/ の試聴プレイヤーを dewplayer(Flash 製)から HTML5 Audio に置き換えるUserscript
// ==UserScript==
// @name Restore Bnkaikei Player
// @namespace http://github.com/
// @version 0.1
// @description Replace Bunkaikei's swf player to html one.
// @author KOBA789 (modified: eggplants)
// @homepage https://github.com/eggplants
// @match http://bunkai-kei.com/release/*
// @grant none
// ==/UserScript==
(function () {
"use strict";
[...document.querySelectorAll('object[data*="/dewplayer.swf"]')].forEach(
(dew) => {
const a = new Audio(new URL(dew.data).searchParams.get("mp3"));
a.controls = true;
a.style.width = "200px";
a.style.height = "20px";
dew.replaceWith(a);
}
);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment