GetBrowserSource: Difference between revisions
Jump to navigation
Jump to search
m (fix syntax) |
(→Syntax) |
||
Line 7: | Line 7: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool getBrowserSource ( browser webBrowser, function callback ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[Element/Browser|browser]]:getSource}} | {{OOP||[[Element/Browser|browser]]:getSource}} |
Revision as of 12:30, 18 July 2016
This article needs checking. | |
Reason(s): example is probably broken |
This function can be used to retrieve the source code of a website (asynchronously). The size of the source code is limited to 2 MiB (remaining bytes are cut).
Syntax
bool getBrowserSource ( browser webBrowser, function callback )
OOP Syntax Help! I don't understand this!
- Method: browser:getSource(...)
Required arguments
- webBrowser: The browser element you want to get the source of
- callback: a callback function with syntax as described below
Callback syntax
function ( string code )
Returns
Returns true if valid arguments have been passed, false otherwise.
Example
local browser = createBrowser(...) -- Assuming a website has already been loaded getBrowserSource(browser, function(code) -- Output code outputChatBox(code) 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