Last active
August 29, 2015 14:07
-
-
Save wbamberg/521a0d314fea271ff0fb to your computer and use it in GitHub Desktop.
This file contains 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
var content = document.getElementById("content"); | |
window.addEventListener("message", function(event) { | |
var debuggee = event.ports[0]; | |
volcan.connect(debuggee). | |
then(listTabs). | |
then(getCurrentStyleSheets). | |
then(writeStyleSheetsLength); | |
}); | |
function listTabs(root) { | |
return root.listTabs(); | |
} | |
function getCurrentStyleSheets(tabList) { | |
var selectedTab = tabList.tabs[tabList.selected]; | |
return selectedTab.styleSheetsActor.getStyleSheets(); | |
} | |
function writeStyleSheetsLength(stylesheets) { | |
content.textContent = stylesheets.length; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment