My goal is to develop a bookmarklet that can add text after the main domain but before any subpath. For example:
http://example.com/home/start -> http://example.com/text/home/start
I am considering storing the full path, removing the domain, replacing it with a regEx pattern to insert the text, and then using document.location.replace to redirect to the new URL.
Do you think this approach is too complicated or just plain silly?