Confusion about 'module' imports
Posted: 2017-12-09, 07:57
So I have an extension that includes a module which provides wrappers for alert, prompt and confirm which stick the name of my extension in the title bar. Because, well, I'm lazy and I find boxes coming up without any hint as to where they came from are rather worrying.
The code (from infoRSS) starts off like this:
and it seemed to work fine.
Today I installed s3.translator so I could see what I was filling in on that Japanese survey.
And all its prompts came up with an inforss prefix.
So what context are extensions run in? Is it a huge global one, where any function name can mess with any other extension? And if so, how the heck is one meant to protect against conflicts?
The code (from infoRSS) starts off like this:
Code: Select all
/* exported EXPORTED_SYMBOLS */
var EXPORTED_SYMBOLS = [
"alert", /* exported alert */
"prompt", /* exported prompt */
"confirm", /* exported confirm */
];
function alert(msg)
{
promptService.alert(null, inforssGetName(), msg);
}
Today I installed s3.translator so I could see what I was filling in on that Japanese survey.
And all its prompts came up with an inforss prefix.
So what context are extensions run in? Is it a huge global one, where any function name can mess with any other extension? And if so, how the heck is one meant to protect against conflicts?