HEX
Server: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
System: Linux Kou-Etsu-Dou 4.4.59+ #25556 SMP PREEMPT Thu Mar 4 18:03:46 CST 2021 x86_64
User: hosam (1026)
PHP: 7.2.29
Disabled: NONE
Upload Files
File: /volume1/@appstore/SynologyApplicationService/ui/authorize/js/Utils.js
/* jshint ignore: start */
/*
 * a Javascript Utils
 * version: v1.0.0
 */
var Utils = (function(){

	var QueryString = function (name) {
		let url = window.location.href;
		name = name.replace(/[\[\]]/g, "\\$&");
		let regex = new RegExp("[?&#]" + name + "(=([^&#]*)|&|#|$)"),
			results = regex.exec(url);
		if (!results) {
			return null;
		}
		if (!results[2]) {
			return '';
		}
		return decodeURIComponent(results[2].replace(/\+/g, " "));
	}

	var ReplacePath = function(path, lc) {
		let loca = lc || window.location;
		let url = loca.origin + loca.pathname.replace(/\/webman.*.html/i, path);
	}

	return {
    	GetParem: QueryString,
		ReplacePath: ReplacePath
	}

}());