Bridge messages between global HTML and injected script