diff options
author | Pierre Ossman <ossman@cendio.se> | 2020-12-04 16:43:04 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2020-12-04 16:43:04 +0100 |
commit | 273acf3e899f70ab71b5cf53854877ddd1595ac4 (patch) | |
tree | b0ba4b6beec1ebcde2be12632143f54451ef8523 | |
parent | 1f7e1c7572a56692c52f18eb72761fa10d9ecb8a (diff) | |
download | novnc-273acf3e899f70ab71b5cf53854877ddd1595ac4.tar.gz |
Remove unused injectParamIfMissing()
It should have been removed in 58fc267b2bac1b89450b76a21e91ffd25e7e4358
with the caller.
-rw-r--r-- | app/webutil.js | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/app/webutil.js b/app/webutil.js index a099f9d..52eab2f 100644 --- a/app/webutil.js +++ b/app/webutil.js @@ -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 |