-
Notifications
You must be signed in to change notification settings - Fork 6
/
Lynda.bsstrategy
27 lines (27 loc) · 998 Bytes
/
Lynda.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
//
// Lynda.plist
// BeardedSpice
//
// Created by Raz Damaschin on 1/14/17.
// Copyright (c) 2017 GPL v3 http://www.gnu.org/licenses/gpl.html
//
BSStrategy = {
version:1,
displayName:"Lynda",
accepts: {
method: "predicateOnTab",
format:"%K LIKE[c] '*www.lynda.com*'",
args: ["URL"]
},
isPlaying: function () {return document.querySelector('button#player-playpause').title.includes("Pause")},
toggle: function () {document.querySelector('button#player-playpause').click()},
next: function () {document.querySelector('button#player-next').click()},
previous: function () {document.querySelector('button#player-previous').click()},
pause: function () {var button = document.querySelector('button#player-playpause'); if (button.title.includes("Pause")) button.click()},
trackInfo: function () {
return {
'track': document.querySelector('h1.default-title').innerText,
'album': document.querySelector('a.headline-course-title').innerText,
};
}
}