My Chrome extension has a Content-Script that injects a custom DIV into the current page. This part works.
But then, the extension also has a right-click Context Menu, w
Wrong document
in
var divHTML = document.getElementById('infoDiv').innerHTML;
Please read the Architecture Overview first. Your background script is executed in a separate HTML document, and as such won't "see" the page in the tab.
You'll need to pass the value to the content script to do something with a visible page. You'll probably need Messaging.