Hello everyone,
I have done an addon for FirefoxOS with all my code into one file. I don’t really like that because the addon is injected into two different apps and there is a test to know which code apply to which app.
The manifest is really well structured because you can apply different js files between distinct apps. So I made a manifest like this one:
“content_scripts”: [{
“matches”: [“app://verticalhome.gaiamobile.org/index.html”],
“css”: [],
“js”: [“js/common.js”, “js/homescreen.js”]
},
{
“matches”: [“app://settings.gaiamobile.org/index.html”],
“css”: [],
“js”: [“js/common.js”, “js/settings.js”]
}],
The JS files are correctly injected into the correct apps. Cool!
But I have some code in common for the two apps and that’s why there is a common.js file into the manifest. The problem is that the functions defined into the common.js file are not existing for the other file (homescreen.js or settings.js).
Someone has an idea on how to resolve this problem. Thank you so much for your help.
The addon works without that but the code could be so much clearer with that and it will help people who will review this addon after submitting it into the marketplace.