-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathOvercast.bsstrategy
41 lines (41 loc) · 1.27 KB
/
Overcast.bsstrategy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// Overcast.plist
// BeardedSpice
//
// Created by Alan Clark 08/06/2014
// Copyright (c) 2014 Tyler Rhodes / Jose Falcon. All rights reserved.
//
// strategy/site notes
// - favorite: not implemented by site
BSStrategy = {
version:1,
displayName:"Overcast.fm",
accepts: {
method: "predicateOnTab",
format:"%K LIKE[c] '*overcast.fm*'",
args: ["URL"]
},
isPlaying:function () {
var p=document.querySelector('#playpausebutton_playicon');
return (p && p.style.display==='none');
},
toggle: function () { document.getElementById('playpausebutton').click();},
next: function () { document.getElementById('seekforwardbutton').click();},
previous: function () { document.getElementById('seekbackbutton').click();},
pause: function () {
var p=document.querySelector('#playpausebutton_playicon');
if(p && p.style.display==='none'){
document.getElementById('playpausebutton').click();
}
},
trackInfo: function () {
var artist=document.querySelector('.caption2 a');
var track=document.querySelector('.title');
var art=document.querySelector('.art.fullart');
return {
'artist': artist ? artist.innerText : null,
'track': track ? track.innerText : null,
'image': art ? art.getAttribute('src') : null
};
}
}