title: Redirect a Website to a local folder Using window.location.href() not working
body: <p><code>developer.android</code> is not available in my country, so I wrote a greasemonkey script to redirect my google search to local android doc in my sdk folder. </p>
  
  <p>But it doesn't work.i</p>
  
  <p>It seems that <code>window.location.href</code> cannot 
  work on local addresses.</p>
  
  <pre><code>// ==UserScript==
  // @name        Android Doc Redirect
  // @namespace   me
  // @author      me
  // @description Redirect developer.android.com to local Documention
  // @include     *http://developer.android.com/*
  // @match        http://developer.android.com/*
  // @version     1.0
  // @grant       none
  // ==/UserScript==
  
  (function() {
    var url = window.location.href;
    var str = "http://developer.android.com/";
    var str2 = "file:///home/user/android-sdk-linux/docs/";
  //   var str2 = "http://google.com";
    if(url.startsWith(str))
      {
        url = url.replace(str, str2);
        window.location.href = url;
      }
  }())
  </code></pre>