Your goal is to make a firefox addon (XPI extension).
The extension will work on as many firefox versions as possible.
The extension will replace some javascript variables if found on the visited page, as explained in the following example:
Example:
the visited page may have the following html code:
<div>line 1</div>
<script>myColor='orange';</script>
<script src=[login to view URL]></script>
<div>line 3</div>
<script>myColor='green';</script>
<script src=[login to view URL]></script>
<div>line 5</div>
<script>myColor='purple';</script>
<script src=[login to view URL]></script>
As you can see, the variable myColor is reused several times, and each time it is redefined, an external javascript is called. In that external javascript, there is only one line of code, which uses the variable: [login to view URL]('color is '+myColor);
Thus output rendered in FireFox browser of this webpage without the extension is:
Line 1
color is orange
Line 3
color green
Line 5
color is purple
The extension will watch all pages visited by the user, and if it detects there is some javascript with defines variable 'myColor' (simplified regex match for [login to view URL] is sufficient), it will make the value uppercase. Thus, the webpage rendered in FireFox with the extension will look like this to the user:
Line 1
color is ORANGE
Line 3
color is GREEN
Line 5
color is PURPLE