Here is my manifest file:
{ "name": "name", "version": "0.0.1", "description": "chrome extension", "permissions": [ "activeTab", "tabs","<all_urls>","http://*/","https://*/" ], "browser_action": { "default_title": "ext", "default_icon": "icon.png", "default_popup": "popup.html" }, "background": { "scripts": ["chrome.js"], "persistent": false }, "manifest_version": 2, "content_security_policy": "script-src 'self' https://ajax.googleapis.com; object-src 'self'" } My background script is embedded into my popup like this:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>popup</title> <meta name="description" content=""> <meta name="author" content="alex"> <script src="chrome.js"></script> </head> <body style="width:400px;height:400px;"> <div id=menu> Menu </div> <a href="#" id="button1">button1</a> <a href="#" id="button2">button2</a> </body> </html> My goal for this back and forth message passing is this: