Make recursive progressiveEnhancements work on non-FF browsers

replace's 3 parameter (flags) is FF-only:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace

Damn you Mozilla and you non-standard implementation!

Change-Id: I8ca25d80f91cbb2abcab5a0dba0a4fb2d6cf8d62