I am trying to communicate some data from my website to my extension's content script that should send it to the background script to store it in my extension's localStorage. What I have done so far is the following : In my webpage , the script is communicating with my extension's content script, one the Content script receives some message it logs in the console 'message received'
My Webpage :
<script>
var go = function() {
var event = document.createEvent('Event');
event.initEvent('appid');
document.dispatchEvent(event);
}
</script>
<a href="javascript:go();">Click me</a>
What I want to achieve is simple to make the webpage send an ID to the CS that passes it to the background script ( since to my knowledge the CS can not handle storing data in localstorage ). Can any one suggest the necessary modification ?