mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Simplified scrobbler code
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
bar = document.querySelector("div[class*=PlayerControls]")
|
||||
if (bar == null) {
|
||||
console.log("Nothing playing right now!")
|
||||
chrome.runtime.sendMessage({type:"stopPlayback"})
|
||||
chrome.runtime.sendMessage({type:"stopPlayback",artist:"",title:""})
|
||||
exit()
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ durationSeconds = parseInt(duration.split(":")[0]) * 60 + parseInt(duration.spli
|
||||
control = bar.querySelector("div[class*=PlayerControls-buttonGroupCenter] > button:nth-child(2)").getAttribute("title")
|
||||
if (control == "Play") {
|
||||
console.log("Not playing right now")
|
||||
chrome.runtime.sendMessage({type:"stopPlayback"})
|
||||
chrome.runtime.sendMessage({type:"stopPlayback",artist:artist,title:title})
|
||||
//stopPlayback()
|
||||
}
|
||||
else if (control == "Pause") {
|
||||
|
||||
Reference in New Issue
Block a user