-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathAnghami.bsstrategy
41 lines (40 loc) · 978 Bytes
/
Anghami.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
//
// Anghami.js
// BeardedSpice
//
// Created by Raja Baz on 08/24/2016.
//
BSStrategy = {
version:1,
displayName:"Anghami",
accepts: {
method: "predicateOnTab",
format:"%K LIKE[c] '*play.anghami.com*'",
args: ["URL"]
},
isPlaying: function () {
return ($(".action.play .icon-pause").length + $(".action.play .loader").length) > 0;
},
toggle: function () {
$(".action.play").click();
},
next: function () {
$('.action.next').click();
},
favorite: function () {
$(".action.extras .icon-like").click();
},
previous: function () {
$('.action.previous').click();
},
pause: function () {
$(".action.play .icon-pause").click();
},
trackInfo: function () {
return {
'track': $("a.track-title").text(),
'artist': $("a.track-artist").text(),
'image': $(".cover-art img")[0].src,
};
}
}