Skip to content

Instantly share code, notes, and snippets.

@callmephilip
Created September 15, 2014 21:51
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 callmephilip/7c132860e4193cee5ff0 to your computer and use it in GitHub Desktop.
Save callmephilip/7c132860e4193cee5ff0 to your computer and use it in GitHub Desktop.
var scripts = document.querySelectorAll("head > script") || [];
var reportData = [];
for(var i=0; i<scripts.length; i++){
if(scripts[i].innerHTML){
reportData.push({
content : scripts[i].innerHTML
});
}
}
chrome.runtime.sendMessage({
from: pageUrl,
meta: {
title: (document.querySelector("head > title") || {}).innerHTML
},
report: reportData
}, function(response){
// process response data
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment