I took a look at this question but I'm having trouble with accessing the current tab's DOM from the chrome extension on startup,
Google Chrome Extension - Accessing The DOM
I have this in the popup page for the chrome extension,
$(document).ready(function() {
chrome.tabs.getSelected(null, function(tab) {
chrome.tabs.sendRequest(tab.id, { }, function(response) {
console.log(response);
});
});
and this in my content script,
chrome.extension.onRequest.addListener(
function(request, sender, sendResponse) {
sendResponse({ doc: document.body });
}
);
When I send a text response back it works, but when I try to send document or document.body, I don't get anything on the receiving end.