fix: early URL polling js error

This commit is contained in:
samuelmaddock 2023-07-10 01:23:43 -04:00
parent 6cadade8aa
commit b7854a3dd9

View File

@ -116,7 +116,11 @@ function PANEL:Think()
end
function PANEL:FetchPageURL()
local js = "gmod.getUrl(window.location.href);"
local js = [[
if (typeof gmod === 'object' && typeof gmod.getUrl === 'function') {
gmod.getUrl(window.location.href);
}
]]
self:RunJavascript(js)
end