I am developing a Firefox extension (FF) and calling a function when a specific button on FF is pressed. Sometimes FF cannot find my function from my script file, even if it exists. Instead, he searches for it in the browser extension and throws an error.
In general, how to use a namespace in front of my function, which will clearly distinguish it from functions, possibly of the same name in other packages.
For example, there is something like:
<script type="application/javascript" src="chrome://mythird/content/script.js"/>
<statusbar id="status-bar">
<statusbarpanel id="mythird-statusbarpanel" label="mythird" onclick="chrome://mythird/myalert();"/>
</statusbar>
instead of just:
<statusbarpanel id="mythird-statusbarpanel" label="mythird" onclick="myalert();"/>
source
share