Skip to content

Instantly share code, notes, and snippets.

@wbamberg
Last active August 29, 2015 14:07
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 wbamberg/521a0d314fea271ff0fb to your computer and use it in GitHub Desktop.
Save wbamberg/521a0d314fea271ff0fb to your computer and use it in GitHub Desktop.
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