Hi,
I’m looking for a worker script that rewrite’s URLs in the response body.
I found a few example scripts, but none workers will accept.
I wonder if somebody can help me with the script found here titled " Rewrite URLs"
I am currently seeing an error when attempting to use the script "Uncaught ReferenceError: Cannot access 'AttributeRewriter' before initialization at line 7"
Please check out https://www.w3schools.com/jsref/jsref_replace.asp. Thats a very fundamental JavaScript question and you’ll need to understand what it is doing before copy/pasting anything. You basically need to call replace on replace.