I want to send message from the console of the random web page to my chrome extension. chrome.extension.sendMessage doesn\'t seem to work.
You can switch to the JS execution context of your content script using the menu at the bottom of a page’s developer JS console, then use chrome.runtime.sendMessage and other chrome.* APIs just as you would within the content script.
chrome.runtime.sendMessage
chrome.*