Shoutbox

Greasemonkey help - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Greasemonkey help (/showthread.php?tid=75859)

Greasemonkey help by Nathan on 07-04-2007 at 07:16 PM

Well I need some help,

Can someone show me how to edit javascript thats on a html page. e.g
<script ...>
alert("boo");
</script>
I want to edit alert("boo");
too
alert("boob");

Thanks guys :)


RE: Greasemonkey help by Jarrod on 07-05-2007 at 08:20 AM

I believe it goes like this
<script ...>
var tex
tex = (document.getElementById('bereich').value);
alert(tex);
</script>
[edit] spelling


RE: Greasemonkey help by -dt- on 07-05-2007 at 08:28 AM

its not possible to edit stuff in the <script> tags unless its inside a function, because greasemonkey is called on DOMContentLoaded and <script> tags run before that event
if its inside a function then from your greasemonkey script you just replace the function like

code:
unsafeWindow.functionName = function(){alert(":o");}

quote:
Originally posted by xen0h
I believe it goes like this
<script ...>
var tex
tex = (document.getElementById('bereich').value);
alert(tex);

[edit] spelling
wtf are you on?, have you ever used greasemonkey? useless++
RE: Greasemonkey help by ShawnZ on 07-05-2007 at 09:07 AM

quote:
Originally posted by xen0h
I believe it goes like this
<script ...>
var tex
tex = (document.getElementById('bereich').value);
alert(tex);
</script>
[edit] spelling

did you.... err... read his post at all?
RE: Greasemonkey help by Jarrod on 07-05-2007 at 09:09 AM

obiously not correctly:p


RE: Greasemonkey help by Nathan on 07-05-2007 at 04:29 PM

Well its a var:
    var maxLoginTime = 60;
So could i edit that in greasemonkey?


RE: Greasemonkey help by markee on 07-06-2007 at 12:45 AM

quote:
Originally posted by Napbree
Well its a var:
    var maxLoginTime = 60;
So could i edit that in greasemonkey?
As long as it isn't used before Greasemonkey has had a chance to start.
RE: Greasemonkey help by WDZ on 07-06-2007 at 01:10 AM

FWIW, Opera's UserJS feature can modify the content of <script> tags...

quote:
User JavaScripts can use the 'BeforeScript' event to detect when a script on a page is about to be interpreted by the JavaScript engine. If needed, the contents of the script can then be rewritten, or prevented from being interpreted.
[Image: zippyrobot.gif]
RE: Greasemonkey help by Nathan on 07-06-2007 at 11:19 AM

Can anyone attach that file (school blocks it),
and is anyone willing to give it a go using greasemonkey?
Thanks.