Answered in Bug 910972, but leaving it here to for future visitors of SO:
The issue was with the page immediately firing postMessage
in the head tag, so the page-mod script isn't even yet attached to the page to listen to the message event. The communication back and forth between page and content scripts as in this example works as long as this timing is taken into consideration