Created
July 11, 2016 18:34
-
-
Save spidergears/00df8b825f98aa108ab24818e09f399b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chrome.browserAction.onClicked.addListener(function(tab) { | |
chrome.tabs.query({}, function(tabs){ | |
for (var i=0; i < tabs.length; i++) { | |
if (/https?:\/\/www\.youtube\.com/.test(tabs[i].url)) { | |
chrome.tabs.sendMessage(tabs[i].id, {action: "toggle_playback"}, function(response) {}); | |
} | |
} | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment