code: function buildHttpURL(uri) {
      var port     = weinre_port
      var pathname = weinre_pathname
  
      if (pathname == "/index.html") pathname = "/"
  
      if (weinre_protocol == "file:") {
          return uri
      }
  
      else if (weinre_protocol == "http:") {
          if (port != "") port = ":" + port
  
          return weinre_protocol + "//" + weinre_host + port + pathname + uri
      }
  
      else if (weinre_protocol == "https:") {
          if (port != "") port = ":" + port
  
          return weinre_protocol + "//" + weinre_host + port + pathname + uri
      }
  }
docs: ---------------------------------------------------------------------