-
Notifications
You must be signed in to change notification settings - Fork 6
/
FocusMusicFM.bsstrategy
43 lines (40 loc) · 1.15 KB
/
FocusMusicFM.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
42
//
// FocusMusicFM.js
// BeardedSpice
//
// Created by Adam Albrecht on 10/19/2016
// Copyright (c) 2016 GPL v3 http://www.gnu.org/licenses/gpl.html
//
BSStrategy = {
version: 1,
displayName: "focusmusic.fm",
accepts: {
method: "predicateOnTab",
format: "%K LIKE[c] '*focusmusic.fm*'",
args: ["URL"]
},
isPlaying: function () { return document.querySelector(".fa-play-circle").classList.contains('hidden'); },
toggle: function () {
if (document.querySelector(".fa-play-circle").classList.contains('hidden')) {
document.querySelector(".fa-pause-circle").click();
} else {
document.querySelector(".fa-play-circle").click();
}
},
previous: function () {
document.querySelector(".controls.previous").click();
},
next: function () {
document.querySelector(".controls.next").click();
},
pause: function () {
document.querySelector(".fa-pause-circle").click();
},
favorite: function () { /* toggles favorite on/off */},
trackInfo: function () {
return {
'track': document.querySelector(".track-title").innerText,
'artist': document.querySelector(".artist").innerText
};
}
}