For the addon I am working on I need to inject some Javascript into the webpage. Currently I do this through a contentScript with pageMod.
var pageMod = require("sdk/page-mod");
pageMod.PageMod({
include: "https://hack.chat/?*",
contentScriptFile: self.data.url("contentScript.js")
});
The site itself has a client.js script. However my contentScript is not able to read vaiables from said script, nor call functions.
For example, the server calls ‘pushMessage(args)’, the script should catch the function call, work some data, then send the message to client.js