I've followed Getting the source HTML of the current page from Chrome extension to get HTML source from current page, and I modified the chrome.runtime.onMessage.addListener
function like this:
chrome.runtime.onMessage.addListener(function(request, sender) {
if (request.action == "getSource") {
message.innerText = request.source;
//my code
window.print();
}
});
But window.print()
does not work, can you please help me correct it?
Thank you very much for any help you can provide!