Created
February 27, 2017 12:25
-
-
Save mohakshah/be79b904c9572a1fd7c972aca4030111 to your computer and use it in GitHub Desktop.
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
// | |
// Saavn.plist | |
// BeardedSpice | |
// | |
// Created by Yash Aggarwal on 1/6/15. | |
// Copyright (c) 2015 Tyler Rhodes / Jose Falcon. All rights reserved. | |
// | |
BSStrategy = { | |
version:2, | |
displayName:"Saavn", | |
accepts: { | |
method: "predicateOnTab", | |
format:"%K LIKE[c] '*saavn.com*'", | |
args: ["URL"] | |
}, | |
isPlaying: function () {}, | |
toggle: function () { | |
var e = document.getElementById('play'); | |
var t = document.getElementById('pause'); | |
if (t.className.indexOf('hide')===-1) { t.click(); } | |
else { e.click(); } | |
}, | |
next: function () { document.getElementById('fwd').click();}, | |
previous: function () { document.getElementById('rew').click();}, | |
pause: function () { document.getElementById('pause').click();}, | |
trackInfo: function () { | |
return { | |
'track': document.getElementById('player-track-name').firstChild.innerHTML, | |
'album': document.getElementById('player-album-name').firstChild.innerHTML, | |
'image': document.querySelector("#now-playing .key-art").getAttribute("style").replace(/(.*)(\")(.*)(\")(.*)/, "$3") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment