SRL Archive - Web Development

Greasemonkey script


Ixilisi

2012-05-13 10:37:52

I want to make a greasemonkey script, but I have little knowledge of any webstuff ie DOM etc.

I want to replace a link that appears on facebook in a stream with my own on, but I need to replace non ASCII characters /hex or something (at least I think so)

like %25 = %
and http%3A%2F%2F = http://

Is there some nice little thing that can do this? I am thinking regex but I don't understand that at all.
And also what crazy DOM stuff or whatever it is called do I use to make it check for new links when they appear on the 'dynamic page' that is Facebook

ShawnjohnSJ

2012-05-14 21:05:06

Can't you just replace the hexadecimal like you would normally with a string?

Ex: replace("%3A", "%2F");

Ixilisi

2012-05-15 03:20:03

From: ShawnjohnSJ
Can't you just replace the hexadecimal like you would normally with a string?

Ex: replace("%3A", "%2F");


Yes I could but I would've thought there would be a built in thing for it, since all the ASCII codes must be readable somehow.

Markus

2012-05-15 03:31:54

escape(stringhere);

Ixilisi

2012-05-15 06:28:30

Thanks for that!
enscape() and unescape() is exactly what I was looking for.