docs: function extractTargetUrl($location, scheme, port) {
          if (angular.isUndefined(scheme)) {
              scheme = $location.scheme();
          }
          var host = $location.host();
          //  $location.search()['url']; does not work for some strange reason
          // let qUrl = $location.search()['url'];
          // if its a proxy request using hawtio-proxy servlet, then the url parameter
          // has the actual host/port
          var qUrl = $location.absUrl();
          var idx = qUrl.indexOf("url=");
          if (idx > 0) {
              qUrl = qUrl.substr(idx + 4);
              var value = decodeURIComponent(qUrl);
              if (value) {
                  idx = value.indexOf("/proxy/");
                  // after proxy we have host and optional port (if port is not 80)
                  if (idx > 0) {
                      value = value.substr(idx + 7);
                      // if the path has http:// or some other scheme in it lets trim that off
                      idx = value.indexOf("://");
                      if (idx > 0) {
                          value = value.substr(idx + 3);
                      }
                      var data = value.split("/");
                      if (data.length >= 1) {
                          host = data[0];
                      }
                      if (angular.isUndefined(port) && data.length >= 2) {
                          var qPort = Core.parseIntValue(data[1], "port number");
                          if (qPort) {
                              port = qPort;
                          }
                      }
                  }
              }
          }
          if (angular.isUndefined(port)) {
              port = $location.port();
          }
          var url = scheme + "://" + host;
          if (port != 80) {
              url += ":" + port;
          }
          return url;
      }