minor javascript cyber

have you ever wanted to parse javascript that has \r\n in it but the dev tools stopped the cyber.

What one can do to parse string with \r\n is to replace the characters with temporary placeholder characters

"string\r\n".replace("\\r\\n","\\\\x\\\\q")
"string\\x\\q".replace(/\\x\\q/gm,"\\r\\n")

now after you have replaced the placeholder characters you should be able to use JSON.parse() on the new string and you can continue with the cyber

Leave a Comment