title: How to replace all <a href="..."> links with a JavaScript window.location link for use in a Web App?
body: <p>I'm building a Progressive Web App for iOS and whenever I click on a link, it opens in Safari and not within the app. I'd like to use JavaScript to replace all the <code>&lt;a href="https://example.com"&gt;Example&lt;/a&gt;</code> with JavaScript window.location links so that links open in the app (for example: <code>&lt;a href="javascript:void" onclick="window.location='http://example.com'"&gt;Example&lt;/a&gt;</code>). I would like to avoid the use of jQuery, as it adds extra bloat to my app and I am trying to keep a minimal user experience.</p>
  
  <p>Thanks!</p>