forked from beardedspice/BS-Strategies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PhishIn.bsstrategy
28 lines (28 loc) · 1004 Bytes
/
PhishIn.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
//
// PhishIn.plist
// BeardedSpice
//
// Created by Frank Febbraro on 01/06/2017.
// Copyright (c) 2017 Frank Febbraro. All rights reserved.
//
BSStrategy = {
version: 1,
displayName: "PhishIn",
accepts: {
method: "predicateOnTab",
format: "%K LIKE[c] '*phish.in*'",
args: ["URL"]
},
isPlaying: function () { return document.querySelector('#control_playpause.playing') !== null; },
toggle: function () { document.querySelector('#control_playpause').click(); },
previous: function () { document.querySelector('#control_previous').click(); },
next: function () { document.querySelector('#control_next').click(); },
pause: function () { document.querySelector('#control_playpause.playing').click(); },
trackInfo: function () {
return {
'track': document.querySelector('#player_title').innerText,
'album': document.querySelector('#player_detail').innerText,
'artist': 'Phish'
};
}
}