ReloadBrowserPage: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
CrosRoad95 (talk | contribs) (add missing "ignoreCache" argument) |
||
(One intermediate revision by one other user not shown) | |||
Line 7: | Line 7: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool reloadBrowserPage( browser webBrowser ) | bool reloadBrowserPage( browser webBrowser [, bool ignoreCache ] ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''webBrowser:''' The browser that you want to reload. | *'''webBrowser:''' The browser that you want to reload. | ||
*'''ignoreCache :''' Ignoring cached content, Equivalent to "Shift + F5" in most browsers | |||
===Returns=== | ===Returns=== | ||
Line 62: | Line 63: | ||
[[hu:reloadBrowserPage]] | [[hu:reloadBrowserPage]] | ||
[[RO:reloadBrowserPage]] |
Latest revision as of 14:27, 9 August 2023
This function reloads the current browser's page.
Syntax
bool reloadBrowserPage( browser webBrowser [, bool ignoreCache ] )
Required Arguments
- webBrowser: The browser that you want to reload.
- ignoreCache : Ignoring cached content, Equivalent to "Shift + F5" in most browsers
Returns
Returns true if the browser has reloaded, false otherwise.
Example
Click to collapse [-]
ClientThis example creates a browser that can return to the last and previous pages and can also be refreshed:
window = guiCreateWindow(126, 122, 848, 674, "Firechrome", false) guiWindowSetSizable(window, false) navigateBackBtn = guiCreateButton(10, 19, 39, 36, "<", false, window) navigateForwardBtn = guiCreateButton(98, 19, 39, 36, ">", false, window) addressBar = guiCreateEdit(137, 19, 701, 36, "", false, window) guiSetEnabled( addressBar, false ) reloadBtn = guiCreateButton(49, 19, 49, 36, "reload", false, window) browser = guiCreateBrowser(10, 55, 828, 609, false, false, false, window) -- Load our page on browser creation. local theBrowser = guiGetBrowser(browser) addEventHandler("onClientBrowserCreated", theBrowser, function() loadBrowserURL(source, "https://forum.mtasa.com/") end ) -- This checks to see if the browser can navigate in any direction and enables the back or forward buttons addEventHandler( "onClientBrowserDocumentReady", theBrowser, function( ) navigateForwardBtn.enabled = (canBrowserNavigateForward(theBrowser)) navigateBackBtn.enabled = (canBrowserNavigateBack(theBrowser)) guiSetText( addressBar, getBrowserURL( theBrowser ) ) end ) -- This part handles the GUI navigation buttons for the browser. addEventHandler( "onClientGUIClick", resourceRoot, function ( ) if source == navigateBackBtn then navigateBrowserBack(theBrowser) elseif source == navigateForwardBtn then navigateBrowserForward(theBrowser) elseif source == reloadBtn then reloadBrowserPage(theBrowser) end end )
See Also
- canBrowserNavigateBack
- canBrowserNavigateForward
- createBrowser
- executeBrowserJavascript
- focusBrowser
- getBrowserProperty
- getBrowserSettings
- getBrowserSource
- getBrowserTitle
- getBrowserURL
- injectBrowserMouseDown
- injectBrowserMouseMove
- injectBrowserMouseUp
- injectBrowserMouseWheel
- isBrowserDomainBlocked
- isBrowserFocused
- isBrowserLoading
- isBrowserRenderingPaused
- loadBrowserURL
- navigateBrowserBack
- navigateBrowserForward
- reloadBrowserPage
- requestBrowserDomains
- resizeBrowser
- setBrowserAjaxHandler
- setBrowserProperty
- setBrowserRenderingPaused
- setBrowserVolume
- toggleBrowserDevTools