From 8a48e8010fa98530ad69e5c5102c4ab4d9c56894 Mon Sep 17 00:00:00 2001 From: ALiangLiang Date: Mon, 29 Jul 2019 01:03:25 +0800 Subject: [PATCH] Support bahamut animation It's a popular animation platform of Taiwan.(https://ani.gamer.com.tw/) --- extension/keysocket-bahamut-animation.js | 17 +++++++++++++++++ extension/manifest.json | 4 ++++ 2 files changed, 21 insertions(+) create mode 100644 extension/keysocket-bahamut-animation.js diff --git a/extension/keysocket-bahamut-animation.js b/extension/keysocket-bahamut-animation.js new file mode 100644 index 0000000..f32c56c --- /dev/null +++ b/extension/keysocket-bahamut-animation.js @@ -0,0 +1,17 @@ +keySocket.init( + "bahamut-animation", + { + "play-pause": function () { + var agreeButton = document.querySelector(".choose-btn-agree"); + if (agreeButton) { + keySocket.simulateClick(agreeButton); + } else { + var playPauseButton = document.querySelector("#ani_video button.vjs-play-control.vjs-control.vjs-button"); + keySocket.simulateClick(playPauseButton); + } + }, + "prev": "#ani_video button.vjs-pre-button", + "next": "#ani_video button.vjs-next-button" + // stop is omitted + } +); \ No newline at end of file diff --git a/extension/manifest.json b/extension/manifest.json index 4002ffb..39a2a00 100644 --- a/extension/manifest.json +++ b/extension/manifest.json @@ -76,6 +76,10 @@ "matches": ["https://developer.apple.com/videos*"], "js": ["plugin-api.js", "keysocket-apple-developer.js"] }, + { + "matches": ["*://ani.gamer.com.tw/animeVideo.php*"], + "js": ["plugin-api.js", "keysocket-bahamut-animation.js"] + }, { "matches": ["*://*.bandcamp.com/*"], "js": ["plugin-api.js", "keysocket-bandcamp.js"]