Here is my script.js and background.html content and error
contentscript.js
chrome.extension.sendRequest({"type":""});
background.html
<script type="text/javascript" charset="utf-8"> chrome.extension.onRequest.addListener( function(request, sender, sendResponse) { chrome.tabs.getCurrent(function(tab){var urls = tab.url;console.log(urls);}); }); </script>
Error message on background.html console
background.html: 7 Uncaught TypeError: Unable to read property 'url' from undefined
It should be an easy change, but I'm stuck.
source share