title: WinRT & UWP WebView localhost url doesn't fire when app is packaged
body: <p>Boy I'm really struggling with this one!</p>
  
  <p>So I have a WinRT Metro application that has an HTML webpage embedded into a webview within the application. In the HTML page there is a div with an href to a localhost url. I'm using this localhost call to communicate with a .NET desktop application that is listening for this url on a localhost port.</p>
  
  <p>When I build the application (as debug or release) in Visual Studio (2015, update 1 or 2), the application works as expected. I can click on the div, the url is fired, and the communication is successful. </p>
  
  <p>However, when I package the application and sideload it on to my machine, the functionality does not work as expected. I can click on the div...but the url is never fired. </p>
  
  <p>HTML Url Example <em>([...] = code removed):</em></p>
  
  <pre><code>&lt;a href="http://localhost:8123/?Api [...] &gt;Click here&lt;/a&gt;
  </code></pre>
  
  <p>Codebehind Navigating to HTML Example:</p>
  
  <pre><code>this.webView.Navigate(new Uri("ms-appdata:///local/index.html"));
  </code></pre>
  
  <p>XAML Webview Instantiation: </p>
  
  <pre><code>&lt;WebView x:Name="webView" Grid.Row="1" ScriptNotify="webView_ScriptNotify" Grid.Column="1" Visibility="Collapsed"/&gt;
  </code></pre>
  
  <p>Here are the things I've tried:</p>
  
  <ol>
  <li>I created a WinRT app that <strong>only</strong> contained the webview and the embedded HTML page. Functionality works when built, but not when packaged.</li>
  <li>I created a UWP app that <strong>only</strong> contained the webview and the embedded HTML page. Functionality works when built, but not when packaged.</li>
  <li>I tried packaging the app outside of Visual Studio using the command line as described <a href="https://blogs.msdn.microsoft.com/wsdevsol/2014/02/12/create-a-windows-store-appx-package-and-sign-it/" rel="nofollow">here.</a> The functionality does not work.</li>
  <li>I tried using different versions of Visual Studio 2015. Same results.</li>
  <li>I tried building/packaging on different machines. Same results.</li>
  <li>I tried to navigate to google instead of the localhost. Works.</li>
  <li>I tried to navigate to another html file instead of the localhost. Works.</li>
  <li>Naturally, I tried the obvious things too like cleaning, changing package name, changing settings in the Visual Studio App Packager, reboots, removing references, etc.</li>
  </ol>
  
  <p>Has anyone experienced this before? It seems to be some sort of bug with the packaging process. Any suggestions/tips/answers are welcome! Thanks!</p>
  
  <p>And just in case you're wondering, this application is intended for enterprise use only within the company I work for and will not be uploaded to the Windows Store.</p>