Skip to content

Instantly share code, notes, and snippets.

@whobutsb
Created November 21, 2019 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whobutsb/bf205a6c5e421c8f604b70f58c96eee3 to your computer and use it in GitHub Desktop.
Save whobutsb/bf205a6c5e421c8f604b70f58c96eee3 to your computer and use it in GitHub Desktop.
Play/Pause SoundCloud
chrome = Application("Google Chrome");
windows = chrome.windows;
for(i = 0; i < windows.length; i++){
tabs = windows[i].tabs;
for(j = 0; j < tabs.length; j++){
url = tabs[j].url();
if(url.match(/soundcloud.com/)){
tabs[j].execute({ javascript: "document.querySelector('.playControl').click();" });
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment