Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Osmo Saarikumpu Newsgroups: comp.lang.javascript Subject: Re: [Browser] How to replace strings in a URL with a javascript boormarklet? Date: Thu, 21 Jul 2016 16:36:03 +0300 Organization: A noiseless patient Spider Lines: 15 Message-ID: References: <7efb128d-dbde-48ec-9f49-edc7fb99ff95@googlegroups.com> <0a3eba30-0511-4cb4-b191-11623ec1fcbc@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 21 Jul 2016 13:36:00 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="81a6eb5755505c8b82db06e223d2d6a8"; logging-data="11626"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+kCl066gf4Y598QjG/DSi5" User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 In-Reply-To: Cancel-Lock: sha1:ySoV9HumRrzvpRZy7Ema2d3wclo= Xref: csiph.com comp.lang.javascript:30957 On 21/07/2016 16:21, Osmo Saarikumpu wrote: > Here is a proposal for the bookmarklet: > > javascript:(function () > {location.assign(decodeURIComponent(location.href.replace(/^.*(http)/,'$1')))})() On second thought: location.assign(decodeURIComponent(location.href.replace(/^.*(http)/,'$1'))) should be sufficient for this one. -- Best wishes, Osmo