Does page-mod not provide a separate javascript context?
Basically, what I have is a some javascript that alters the page. The javascript I am using to do this is not only my custom JS but includes jQuery and a number of jQuery plugins.
However, I do not want to remote page to have any interaction with my javascript and I also do not need/want access to the remote pages javascript.
Any suggestions.
Thanks
--
You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To post to this group, send email to mozilla-la...@googlegroups.com.
To unsubscribe from this group, send email to mozilla-labs-jet...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mozilla-labs-jetpack?hl=en.
Attached is an very simple example that adds a function called sayhello. Then I have the page that loades in the browser call the function.
On the note if I load the test2.html file with file open. No issue function is undefined. When I load it if my http://localhost/test2.html. It will call the function.
var pageMod = require("page-mod");
var my_extra_js = "window.sayhello = function() { alert('hello from insite bx')};";
pageMod.add(new pageMod.PageMod({
include: ["*"],
contentScriptWhen: 'ready',
contentScript: my_extra_js
}));
Example Script
<script>
function go()
{
try
{
alert("about to");
sayhello();
}
catch(aaa)
{
alert("error" + aaa.message);
}
}
setTimeout(go,4000);
</script>
--