From 9917a9c33fb3017d6bd99e4afea6b5855f5015f4 Mon Sep 17 00:00:00 2001 From: Morgan Engel Date: Tue, 28 Nov 2017 15:26:38 -0800 Subject: [PATCH 1/2] Add support for hearthis.at --- README.md | 1 + extension/keysocket-hearthis.js | 15 +++++++++++++++ extension/manifest.json | 4 ++++ 3 files changed, 20 insertions(+) create mode 100644 extension/keysocket-hearthis.js diff --git a/README.md b/README.md index 22031e9..76041f7 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ when you're listening to music on various streaming websites. * Gaana.com * Google Play Music * Groove Music + * HearThis.at * Hype Machine * iloveradio.de * Jamstash diff --git a/extension/keysocket-hearthis.js b/extension/keysocket-hearthis.js new file mode 100644 index 0000000..c9a98fd --- /dev/null +++ b/extension/keysocket-hearthis.js @@ -0,0 +1,15 @@ +keySocket.init( + "hearthis", + { + "play-pause": function(){ + if(document.querySelector(".play_track").className.search(/hidden/) > 0) { + document.querySelector('.fa-pause').click() + } else { + document.querySelector('.fa-play').click() + } + } + // prev is omitted + // next is omitted + // stop is omitted + } +); diff --git a/extension/manifest.json b/extension/manifest.json index 333a7fe..6188e32 100644 --- a/extension/manifest.json +++ b/extension/manifest.json @@ -104,6 +104,10 @@ "matches": ["*://music.microsoft.com/*"], "js": ["plugin-api.js", "keysocket-groovemusic.js"] }, + { + "matches": ["*://hearthis.at/*"], + "js": ["plugin-api.js", "keysocket-hearthis.js"] + }, { "matches": ["*://hypem.com/*"], "js": ["plugin-api.js", "keysocket-hypem.js"] From 07f7135281568000b1d85707fc04313fdfafd33a Mon Sep 17 00:00:00 2001 From: Morgan Engel Date: Wed, 29 Nov 2017 15:32:11 -0800 Subject: [PATCH 2/2] Found the next button, so I added it. --- extension/keysocket-hearthis.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extension/keysocket-hearthis.js b/extension/keysocket-hearthis.js index c9a98fd..8081583 100644 --- a/extension/keysocket-hearthis.js +++ b/extension/keysocket-hearthis.js @@ -7,9 +7,11 @@ keySocket.init( } else { document.querySelector('.fa-play').click() } - } + }, + "next": function(){ + document.querySelector('.fa-fast-forward').click() + } // prev is omitted - // next is omitted // stop is omitted } );