ToggleBrowserDevTools: Difference between revisions
Jump to navigation
Jump to search
m (add oop variable) |
m (Link to the Romanian translation of this page added.) |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 4: | Line 4: | ||
This function toggles the visibility of the developer tools pane. | This function toggles the visibility of the developer tools pane. | ||
}} | }} | ||
{{Note|You should do a 'setDevelopmentMode(true, true)' before using this function.}} | |||
==Syntax== | ==Syntax== | ||
Line 9: | Line 10: | ||
bool toggleBrowserDevTools ( browser webBrowser, bool visible ) | bool toggleBrowserDevTools ( browser webBrowser, bool visible ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[browser]]: | {{OOP||[[browser]]:toggleDevTools|devTools}} | ||
===Required Arguments=== | ===Required Arguments=== | ||
Line 19: | Line 20: | ||
==Example== | ==Example== | ||
This example will output browser console logs to debugscript. | |||
<syntaxhighlight lang="lua"> | |||
local GUI_browser = guiCreateBrowser(100,100,640,480,false,false,false) -- Create Browser | |||
local browser = guiGetBrowser(GUI_browser) -- Get browser from GUI element | |||
setDevelopmentMode(true, true) -- Enable client dev mode | |||
addEventHandler("onClientBrowserCreated", browser, function() | |||
toggleBrowserDevTools(browser, true) -- Toggle the CEF dev console | |||
end) | |||
</syntaxhighlight> | |||
==See also== | ==See also== | ||
{{CEF_functions}} | {{CEF_functions}} | ||
[[hu:toggleBrowserDevTools]] | |||
[[RO:toggleBrowserDevTools]] |
Latest revision as of 15:19, 8 April 2020
This function toggles the visibility of the developer tools pane.
Syntax
bool toggleBrowserDevTools ( browser webBrowser, bool visible )
OOP Syntax Help! I don't understand this!
- Method: browser:toggleDevTools(...)
- Variable: .devTools
Required Arguments
- webBrowser: The browser
- visible: true to show the tools, false to hide
Returns
Returns true if the visibility was successfully toggled, false if an error occurred
Example
This example will output browser console logs to debugscript.
local GUI_browser = guiCreateBrowser(100,100,640,480,false,false,false) -- Create Browser local browser = guiGetBrowser(GUI_browser) -- Get browser from GUI element setDevelopmentMode(true, true) -- Enable client dev mode addEventHandler("onClientBrowserCreated", browser, function() toggleBrowserDevTools(browser, true) -- Toggle the CEF dev console 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