How To Rewrite Urls Referenced By Javascript Code?
This is a follow-up to my popular and technically challenging HTML injection into someone else's website? question. To recap: I'd like to demo my technology to customers without ac
Solution 1:
Very challenging and interesting task. I would go with first saving the javascript files on my server and reference them from the HTML served. Then I would find the URLs in the files (using a regex or something) and replace it with the wanted value. I know it is not very fast, it is not very dynamic and all, but I believe it would be easier to implement.
Hope I helped!
Solution 2:
Answering my own question.
After much research, I find this technique works best: https://stackoverflow.com/a/23231268/14731
In other words, there doesn't seem to be a general algorithm to rewrite links. Patching them by hand isn't as much work as you'd expect.
Post a Comment for "How To Rewrite Urls Referenced By Javascript Code?"