Last active
February 16, 2018 07:54
-
-
Save theoria24/b1789db3657923e17345825e874e9b34 to your computer and use it in GitHub Desktop.
mastodonでふぁぼったときに音を鳴らす
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name FavSound4Mstdn | |
// @namespace https://github.com/theoria24 | |
// @version 0.2.2 | |
// @description ふぁぼったときに音を鳴らすやつ | |
// @author theoria | |
// @match https://theboss.tech/* | |
// @grant none | |
// @require http://code.jquery.com/jquery-2.2.4.min.js | |
// @require https://cdn.jsdelivr.net/npm/ion-sound@3.0.7/js/ion.sound.min.js | |
// @license MIT License | |
// @downloadURL https://gist.github.com/theoria24/b1789db3657923e17345825e874e9b34/raw/FavSound4Mstdn.user.js | |
// ==/UserScript== | |
ion.sound({ | |
sounds: [ | |
{name: "button_tiny"}, | |
], | |
path: "https://cdn.jsdelivr.net/npm/ion-sound@3.0.7/sounds/", | |
preload: true, | |
multiplay: true | |
}); | |
(function() { | |
'use strict'; | |
$(document).on("click", ".icon-button:has(.fa-star)", function(){ | |
ion.sound.play("button_tiny"); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tampermonkeyなどのユーザースクリプトが実行できる環境が前提です。
をお使いのインスタンスのアドレスに変更してください。複数指定もできます。
// @match
をたくさん書く感じです。解除時に鳴らないように.activeでフィルターしたかったんですけど知識がないので無理でした。
音声ファイルにもCDNを指定していますが、自分のサーバーとかに上げておくのが丸いです。
MITライセンスです。