about sending messages among bg.html, popup.html and contentscript.js
- by T_t
Hi!:)
In my extension, when a button named "mybutton1" in the popup.html is
clicked, it sends a message "getvar1" to the contentscript.js, then
the contentscript.js sends a message "i want var1" to the
background.html to get an object named "var1".If the button named
"mybutton2" is clicked, the contentscript.js gets the "var2" object.
How should i do under this condition?
What's more, i am a little confused about the
chrome.extension.onRequest.addListener method and
chrome.extension.sendRequest method.Could someone tell me the
mechanism of the two methods?
Thanks!