2026-07-27 11:26:19 +00:00
|
|
|
// Module ID: 13431
|
|
|
|
|
// Function ID: 103152
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: getHostFromUrl
|
|
|
|
|
// Dependencies: []
|
|
|
|
|
|
2026-07-27 11:26:19 +00:00
|
|
|
// Module 13431 (getHostFromUrl)
|
2026-07-20 16:05:17 +00:00
|
|
|
arg5.getHostFromUrl = function getHostFromUrl(scriptURL) {
|
|
|
|
|
const match = scriptURL.match(/^(?:https?:\/\/)?(\[[^\]]+\]|[^/:\s]+)(?::\d+)?(?:[/?#]|$)/);
|
|
|
|
|
let tmp2;
|
|
|
|
|
if (null != match) {
|
|
|
|
|
tmp2 = match[1];
|
|
|
|
|
}
|
|
|
|
|
if ("string" !== typeof tmp2) {
|
|
|
|
|
const _Error = Error;
|
|
|
|
|
const error = new Error("Invalid URL - host not found");
|
|
|
|
|
throw error;
|
|
|
|
|
} else {
|
|
|
|
|
return tmp2;
|
|
|
|
|
}
|
|
|
|
|
};
|