One Greasemonkey Script


Funny i thought just yesterday about the possibility of someone making a greasemonkey script to combat the evil bugs, turned out my thoughts can make things happen! :rolleyes:
 
Last edited by a moderator:
PoisonedV said:
smileys and links and pics dont work for me, creature. weird.
Sorry, those things are handeled by the server and can't be changed easily by a GM script. As I said, this is only a hack and isn't perfect. If I would have to do BBCode parsing in my little script, I'd still be typing today.
 
Last edited by a moderator:
'dflemstr' said:
'PoisonedV' said:
smileys and links and pics dont work for me, creature. weird.
Sorry, those things are handeled by the server and can't be changed easily by a GM script. As I said, this is only a hack and isn't perfect. If I would have to do BBCode parsing in my little script, I'd still be typing today.Actually, just for URLs it shouldn't be that hard. I'll look into it tonight.
 
Last edited by a moderator:
Slightly improved version of the script here CODE
http://pastie.org/413751
Helps a bit, but it still doesn't remove some garbage from the end of links.

Also changed for ( d in tds) to for(var d in tds) because I felt pedantic.
 
Last edited by a moderator:
The one sinbad just posted works fine in Opera. Just name it .user.js.

But for some reason it disables Windows 7's Aero, I just blame an incompatibility with it and java.
 
Last edited by a moderator:
'fischju2000' said:
The one sinbad just posted works fine in Opera. Just name it .user.js.

But for some reason it disables Windows 7's Aero, I just blame an incompatibility with it and java.
A js script inside a webpage changing system settings? I think it's an Opera and Windows 7 incompatibility.
 
Last edited by a moderator:
Maybe it's because I'm on build 7000 instead of a newer one, but anything Java in Opera causes that. Also on beta WDDM1.1 drivers...

edit: Does the same thing in newest Firefox, perhaps I should update Java from 07 to 12 edit again: did that, no longer disables in FF but this script still disables it when using Opera
 
Last edited by a moderator:
Oh, I forgot to mention that I'm using the latest alpha build of Opera v10.
 
Last edited by a moderator:
You know what would be an even better fix for the forum bugs? If the forum got fixed.

This script is a good hack in the meantime, though. Hopefully it will not be necessary for much longer, but it probably will be.
 
sindbad said:
Slightly improved version of the script here CODE
http://pastie.org/413751
Helps a bit, but it still doesn't remove some garbage from the end of links.

Also changed for ( d in tds) to for(var d in tds) because I felt pedantic.

OK, the line you added was:
CODE
contents = contents.replace(/<a href=".*http/g, "<a href=\"http");
Now... how does this help? the ".*" is greedy and thus makes this line do dangerous stuff :p
And the 2 lines above that one already fixes links, at least in FF

I could try something like
CODE
contents = contents.replace(/<a href=".*?http/g, "<a href=\"http");


(note extra question mark)
...but it wouldn't change much anyways, since that would prevent ftp links and such.

Also, the "var d" vs "d" actually has (or had a while ago) some performance issues: I wrote the code without the "var" to prevent firefox to make a new field for the var every time the loop went through, because that's what it does otherwise.

I am grateful for all comments and improvements, though; if someone has a better version of the code, post it and I will upload it to the original link.
 
Last edited by a moderator:
'dflemstr' said:
Now... how does this help? the ".*" is greedy and thus makes this line do dangerous stuff :p
And the 2 lines above that one already fixes links, at least in FF

I could try something like
CODE
contents = contents.replace(/<a href=".*?http/g, "<a href=\"http");


(note extra question mark)
...but it wouldn't change much anyways, since that would prevent ftp links and such.

Also, the "var d" vs "d" actually has (or had a while ago) some performance issues: I wrote the code without the "var" to prevent firefox to make a new field for the var every time the loop went through, because that's what it does otherwise.

I am grateful for all comments and improvements, though; if someone has a better version of the code, post it and I will upload it to the original link.I didn't know about the performance thing for var declarations, I'll need to check. Thing is, declarations without var are global. Not that it matters in this case anyway, hence pedantic.

I know it's potentially dangerous, but that's the only way I could get it to work in Safari too. I'll look into it some more.

[edit]
Got it! CODE
http://pastie.org/414344
Works in Safari for me, probably other webkits as well.

That'll teach me to develop in firefox!
 
Last edited by a moderator:
OK guys, new script version. See the first post for the link.

New in this version:
- Copied in sindbad's changes. Thanks! I only have Arora to test WebKit with, which doesn't have GM, so I really appreciate if you can test on other platforms.
- Look at this post:
www.gp32x.de/board/index.php?s=&showtopic=47019&view=findpost&p=708329
Pretty screwed up, even with the old GM script on, eh?
Well, fortunately for you, the new version fixes almost all the bugs that are on display in that post. The error with the normal smiling and winking smileys ( :) and ;) ) still puzzles me, though; input appreciated!

EDIT: Fixed some bugs, new version again...
 
Last edited by a moderator:
Somehow I got it to work properly in Opera, and it's very nice
 
Last edited by a moderator:
What is opera on (WebKit, Gecko etc)? Someone able to test the absolutely latest update (that I made a minute ago)? My dream would be that everyone would have a script or something similar so that the normal BBCodes could be used again.

The last update has support for all smileys, URLs are completely fixed and some minor glitches were looked upon, too.

When we have a good-enough
 
'dflemstr' said:
What is opera on (WebKit, Gecko etc)? Someone able to test the absolutely latest update (that I made a minute ago)?
Its own, called Presto. I'll test it if I can figure out greasemonkey on opera.
'dflemstr' said:
When we have a good-enough -implementation, all will be well (aka, the forum will be as it was before with the script enabled)
I'll have a look at your latest script.
 
Last edited by a moderator:
It's updated constantly at the moment, you might want to wait 5 min or so until I've made some final touches. FireBug is now my favourite plugin for Firefox :p
 
Last edited by a moderator:
I just installed this script. Thank you, dflemstr! I could no longer tolerate the headache that all these bugs were causing. They're still there, but at least I can pretend they're not.
 
Last edited by a moderator:
Back
Top