View Issue Details

IDProjectCategoryView StatusLast Update
0009377Multi Theft Auto : San AndreasCEFpublic2016-09-13 22:02
ReporterNecktroxAssigned ToJusonex 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformv1.5.2-release-9928OSWindowsOS Version10
Product Version 
Target Version1.5.3Fixed in Version1.5.3 
Summary0009377: Unable to navigate to accepted URL from event onClientBrowserNavigate
Description

If you access-request the blocked URL from inside the event onClientBrowserNavigate and then try to load the URL when it got accepted by the client, then it won't work. Navigating forward or reloading the page doesn't work either.

TagsNo tags attached.

Activities

Jusonex

2016-09-12 13:09

administrator   ~~0025180

Could you please provide some test code?

I was able to reproduce the bug with the following code though:

local g = guiCreateBrowser(0, 0, 800, 600, false, false, false)

addEventHandler("onClientBrowserNavigate", g.browser,
function(url)
outputDebugString("Requesting: "..url)
requestBrowserDomains({url}, true, function() g.browser:loadURL("https://mtasa.com") end)
end
)

addCommandHandler("load", function() g.browser:loadURL("https://mtasa.com") end)

However, I'm not sure if we're talking about the same bug.

The problem in this code is that requestBrowserDomains calls the callback immediately in case the URL has been whitelisted already. This behavior leads to OnBeforeBrowser and loadBrowserURL being executed infinitely then.

Necktrox

2016-09-12 23:24

developer   ~~0025186

My reduced code looks exactly like that and the result is that the URL in the callback (the blocked URL) didn't load after being accepted.

Jusonex

2016-09-13 11:05

administrator   ~~0025188

It doesn't make sense to fix this issue then as loadBrowserURL triggers onClientBrowserNavigate by design.

To fix your code snippet, you can use isBrowserDomainBlocked before calling requestBrowserDomains.

Jusonex

2016-09-13 22:01

administrator   ~~0025194

Fixed in https://github.com/multitheftauto/mtasa-blue/commit/c6b3acf897fd2c20e56693d5ceac7d0ae8dab2d9

Issue History

Date Modified Username Field Change