I used to use a specific app 'TestSystemMessage' to do this test. Thus I did set the message handler in the app source code. But Dave Hunt suggested me to use the general purpose app TestContainer to perform this test. That's why I have to inject javascript code rather than adding it directly to the app. Do you think if I should go back to the specific app approach?