Update webutil.js

fixing the extra spaces
This commit is contained in:
yatru 2021-08-30 10:58:07 +02:00 committed by GitHub
parent c581d78453
commit 41b1bdc737
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -26,13 +26,13 @@ export function initLogging(level) {
// For privacy (Using a hastag #, the parameters will not be sent to the server) // For privacy (Using a hastag #, the parameters will not be sent to the server)
// the url can be requested in the following way: // the url can be requested in the following way:
// https://www.example.com#myqueryparam=myvalue&password=secreatvalue // https://www.example.com#myqueryparam=myvalue&password=secreatvalue
// //
// Even Mixing public and non public parameters will work: // Even Mixing public and non public parameters will work:
// https://www.example.com?nonsecretparam=example.com#password=secreatvalue // https://www.example.com?nonsecretparam=example.com#password=secreatvalue
export function getQueryVar(name, defVal) { export function getQueryVar(name, defVal) {
"use strict"; "use strict";
const re = new RegExp('.*[?&]' + name + '=([^&#]*)'), const re = new RegExp('.*[?&]' + name + '=([^&#]*)'),
match = ''.concat(document.location.href," ", window.location.hash).match(re); match = ''.concat(document.location.href, " ", window.location.hash).match(re);
if (typeof defVal === 'undefined') { defVal = null; } if (typeof defVal === 'undefined') { defVal = null; }
if (match) { if (match) {