]> git.proxmox.com Git - mirror_novnc.git/blobdiff - app/webutil.js
Remove unused injectParamIfMissing()
[mirror_novnc.git] / app / webutil.js
index a099f9d7026cc0e11cfb1a188ff1fa97f1b1c096..52eab2fb6fe7ae21398ba71d95b45b27bbc9bb42 100644 (file)
@@ -176,36 +176,6 @@ export function eraseSetting(name) {
     }
 }
 
-export function injectParamIfMissing(path, param, value) {
-    // force pretend that we're dealing with a relative path
-    // (assume that we wanted an extra if we pass one in)
-    path = "/" + path;
-
-    const elem = document.createElement('a');
-    elem.href = path;
-
-    const paramEq = encodeURIComponent(param) + "=";
-    let query;
-    if (elem.search) {
-        query = elem.search.slice(1).split('&');
-    } else {
-        query = [];
-    }
-
-    if (!query.some(v => v.startsWith(paramEq))) {
-        query.push(paramEq + encodeURIComponent(value));
-        elem.search = "?" + query.join("&");
-    }
-
-    // some browsers (e.g. IE11) may occasionally omit the leading slash
-    // in the elem.pathname string. Handle that case gracefully.
-    if (elem.pathname.charAt(0) == "/") {
-        return elem.pathname.slice(1) + elem.search + elem.hash;
-    }
-
-    return elem.pathname + elem.search + elem.hash;
-}
-
 // sadly, we can't use the Fetch API until we decide to drop
 // IE11 support or polyfill promises and fetch in IE11.
 // resolve will receive an object on success, while reject