forked from beardedspice/BS-Strategies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SiriusXM.bsstrategy
31 lines (28 loc) · 1.02 KB
/
SiriusXM.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
//
// SiriusXM.js
// BeardedSpice
//
// Created by Amit Chaudhari on 8/17/2017.
// Updated by Steven Dickenson on 3/17/2022.
// Copyright (c) 2017 GPL v3 http://www.gnu.org/licenses/gpl.html
//
BSStrategy = {
version: 2,
displayName: "SiriusXM",
accepts: {
method: "predicateOnTab",
format: "%K LIKE[c] '*player.siriusxm.com*'",
args: ["URL"]
},
isPlaying: function () {document.querySelector('.play-pause-btn').title == 'Pause'},
previous: function () {document.querySelector('.skip-back-btn').click();},
next: function () {document.querySelector('.skip-forward-btn').click();},
pause: function () {if (document.querySelector('.play-pause-btn').title == 'Pause') document.querySelector('.play-pause-btn').click();},
toggle: function () {document.querySelector('.play-pause-btn').click();},
trackInfo: function () {
return {
'track': document.querySelector('.track-name').innerText.trim(),
'artist': document.querySelector('.artist-name').innerText.trim()
};
}
}