CanBrowserNavigateForward: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
|||
Line 61: | Line 61: | ||
{{CEF_functions}} | {{CEF_functions}} | ||
[[ar:canBrowserNavigateForward]] | |||
[[en:CanBrowserNavigateForward]] | |||
[[hu:canBrowserNavigateForward]] | [[hu:canBrowserNavigateForward]] | ||
[[RO:canBrowserNavigateForward]] | [[RO:canBrowserNavigateForward]] |
Latest revision as of 18:41, 21 February 2021
This function checks if the browser can go to the next page.
Syntax
bool canBrowserNavigateForward( browser webBrowser )
Required Arguments
- webBrowser: The browser you want check for a next page.
Returns
Returns true if the browser can go to the next page, 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, "browser", false) guiWindowSetSizable(window, false) navigateBackBtn = guiCreateButton(10, 19, 39, 36, "<", false, window) navigateForwardBtn = guiCreateButton(98, 19, 39, 36, ">", false, window) reloadBtn = guiCreateButton(49, 19, 49, 36, "reload", false, window) addressBar = guiCreateEdit(137, 19, 701, 36, "", false, window) guiSetEnabled(addressBar,false) webBrowser = guiCreateBrowser(10, 55, 828, 609, false, false, false, window) local theBrowser = guiGetBrowser(webBrowser) -- Load our page on browser creation. addEventHandler("onClientBrowserCreated", theBrowser, function() showCursor(true) loadBrowserURL(source, "https://forum.mtasa.com/") end ) addEventHandler( "onClientBrowserDocumentReady", theBrowser, function( url ) guiSetText( addressBar, getBrowserURL( theBrowser ) ) end ) -- This part handles the GUI navigation buttons for the browser. addEventHandler( "onClientGUIClick", resourceRoot, function ( ) if source == navigateBackBtn then if canBrowserNavigateBack(theBrowser) ~= true then return end -- This checks to see if the browser can navigate to the back navigateBrowserBack(theBrowser) elseif source == navigateForwardBtn then -- This checks to see if the browser can navigate to the forward if canBrowserNavigateForward(theBrowser) ~= true then return end 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