This page demonstrates messaging between page scripts and content scripts.

To try it out, first install the WebExtension from, then reload this page.

Clicking one button sends a message from the page script to the content script: the content script just displays an alert when it receives the message. Clicking the other button sends a message the other way.