Skip to content

Instantly share code, notes, and snippets.

@KOBA789
Last active November 7, 2021 18:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save KOBA789/ea74c19a738a153e62600bf001b3ddd7 to your computer and use it in GitHub Desktop.
Save KOBA789/ea74c19a738a153e62600bf001b3ddd7 to your computer and use it in GitHub Desktop.
http://bunkai-kei.com/ の試聴プレイヤーを dewplayer(Flash 製)から HTML5 Audio に置き換えるブックマークレット

1. ブックマークレットを登録

下記内容を全部コピーして、それを URL としてブックマークを登録。

javascript:%5B...document.querySelectorAll('object%5Bdata*=%22/dewplayer.swf%22%5D')%5D.forEach(dew=%3E%7Bconst%20a=new%20Audio(new%20URL(dew.data).searchParams.get('mp3'));a.controls=true;a.style.width='200px';a.style.height='20px';dew.replaceWith(a);%7D);void(0);

2. ブックマークレットをクリック

bunkai-kei.com の楽曲ページで上記ブックマークをクリック

[...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