-
Notifications
You must be signed in to change notification settings - Fork 6
/
Astiga.bsstrategy
33 lines (33 loc) · 975 Bytes
/
Astiga.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
//
// Astiga.js
// BeardedSpice
//
// Created by Chloe Stars on 8/16/16.
// Slightly modified by Alexander Kellett on 2022-05-08.
// Copyright © 2016, 2022 GPL v3 http://www.gnu.org/licenses/gpl.html
//
BSStrategy = {
version:1,
displayName:"Astiga",
accepts: {
method: "predicateOnTab",
format:"%K LIKE[c] '*play.asti.ga*'",
args: ["URL"]
},
isPlaying: function () {return !(document.querySelector('audio').paused);},
toggle: function () {
var theAudio = document.getElementsByTagName("audio")[0];
if (theAudio.paused) { theAudio.play(); }
else { theAudio.pause() }
},
next: function () {},
favorite: function () {},
previous: function () {},
pause: function () {document.getElementsByTagName("audio")[0].pause();},
trackInfo: function () {
return {
'track': document.getElementsByClassName("song-title")[0].textContent,
'album': document.getElementsByClassName("song-album")[0].textContent
}
}
}