-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathRedditMusic.bsstrategy
28 lines (28 loc) · 1.06 KB
/
RedditMusic.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
//
// RedditMusic.plist
// BeardedSpice
//
// Created by Travis Emery on 11/16/16.
// Copyright (c) 2015-2016 GPL v3 http://www.gnu.org/licenses/gpl.html
//
BSStrategy = {
version:1,
displayName:"RedditMusic",
accepts: {
method: "predicateOnTab",
format:"%K LIKE[c] '*reddit.musicplayer.io*'",
args: ["URL"]
},
isPlaying: function () { return !document.querySelector('#movie_player video').paused; },
toggle: function () { document.querySelector('.controls .item.play.button').click(); },
previous: function () { document.querySelector('.controls .item.backward.button').click(); },
next: function () { document.querySelector('.controls .item.forward.button').click(); },
pause: function () { document.querySelector('#movie_player video').pause(); },
trackInfo: function () {
return {
'image': document.querySelector('link[itemprop=thumbnailUrl]').getAttribute('href'),
'track': document.querySelector('meta[itemprop=name]').getAttribute('content'),
'artist': document.querySelector('.yt-user-info').innerText
};
}
}