Skip to content

Commit

Permalink
Merge pull request #235 from alfstorm/nrk-css-selector
Browse files Browse the repository at this point in the history
Changed nrkradio to use CSS selector instead of API call.
  • Loading branch information
feedbee committed Jul 28, 2017
2 parents 382f95e + effe7dc commit 5ad2bbb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 5 additions & 9 deletions extension/keysocket-nrkradio.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
/*
* NRK radio only supports a flash player on chrome desktop at the moment,
* so we have to talk to an api in the browser window to get media buttons working.
*/

injectionInit(function (key) {
if (key === "play-pause") {
nrk.modules.player.getApi().toggleplay();
function onKeyPress(key) {
if (key === PLAY) {
var playPauseButton = document.querySelector('button.ludo-bar__button--playpause');
simulateClick(playPauseButton);
}
});
}
2 changes: 1 addition & 1 deletion extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
},
{
"matches": ["*://radio.nrk.no/*"],
"js": ["shared.js", "shared-injection.js", "keysocket-nrkradio.js"]
"js": ["shared.js", "keysocket-nrkradio.js"]
},
{
"matches": ["*://ok.ru/*"],
Expand Down

0 comments on commit 5ad2bbb

Please sign in to comment.