im simply trying to create a surrogate script that will essentially overwrite function "test" after the page loads:
Code: Select all
user_pref("noscript.surrogate.test.replacement", "window.test=function(){alert('changed')}");
user_pref("noscript.surrogate.test.sources", "^file://*");
Code: Select all
<script>
function test() { alert("original") }
</script>
<button onclick=test()>test</button>
this should work because my javascript logic is correct:
Code: Select all
<script>
function test() { alert("original") }
window.test = function() {alert('changed')} // what the surrogate should pretty much be doing
</script>
<button onclick=test()>test</button>
<!-- alerts "changed" -->
Code: Select all
user_pref("noscript.surrogate.test.replacement", "alert('test')");
user_pref("noscript.surrogate.test.sources", "^file://*");