OnClientBrowserLoadingStart: Difference between revisions
Jump to navigation
Jump to search
Lars-Marcel (talk | contribs) No edit summary |
Lars-Marcel (talk | contribs) No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 10: | Line 10: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''URL:''' [[string]] containing the URL that will be loaded. | *'''URL:''' [[string]] containing the URL that will be loaded. | ||
*''' | * {{New feature/item|3.0160|1.6|7888|'''isMainFrame:''' a [[boolean]] representing whether the entire page (main frame) was loaded or an ''<iframe>'' inside the page was loaded. | ||
** '''true''': If the URL is loaded in the main frame. | ** '''true''': If the URL is loaded in the main frame. | ||
** '''false''': If the URL is loaded in a | ** '''false''': If the URL is loaded in a ''<iframe>''.}} | ||
==Source== | ==Source== | ||
Line 24: | Line 26: | ||
addEventHandler("onClientBrowserLoadingStart", theBrowser, function(url, | addEventHandler("onClientBrowserLoadingStart", theBrowser, function(url, isMainFrame) | ||
if ( | if (isMainFrame) then | ||
outputChatBox("Loading "..url.." in the main frame...") | outputChatBox("Loading "..url.." in the main frame...") | ||
else | else | ||
outputChatBox("Loading "..url.." in a | outputChatBox("Loading "..url.." in a iframe...") | ||
end | end | ||
end) | end) |
Latest revision as of 20:30, 19 September 2018
The event is triggered when a webbrowser starts loading a page.
Parameters
string URL, boolean isMain
- URL: string containing the URL that will be loaded.
- isMainFrame: a boolean representing whether the entire page (main frame) was loaded or an <iframe> inside the page was loaded.
- true: If the URL is loaded in the main frame.
- false: If the URL is loaded in a <iframe>.
Source
The webbrowser element.
Example
local browser = guiCreateBrowser(0, 0, 800, 600, false, false, false) local theBrowser = guiGetBrowser(browser) showCursor(true) addEventHandler("onClientBrowserLoadingStart", theBrowser, function(url, isMainFrame) if (isMainFrame) then outputChatBox("Loading "..url.." in the main frame...") else outputChatBox("Loading "..url.." in a iframe...") end end) addEventHandler("onClientBrowserCreated", theBrowser, function() loadBrowserURL(source, "https://www.w3schools.com/html/html_iframe.asp") end)
See Also
- onClientBrowserCreated
- onClientBrowserCursorChange
- onClientBrowserDocumentReady
- onClientBrowserInputFocusChanged
- onClientBrowserLoadingFailed
- onClientBrowserLoadingStart
- onClientBrowserNavigate
- onClientBrowserPopup
- onClientBrowserResourceBlocked
- onClientBrowserTooltip
- onClientBrowserWhitelistChange