Module webview
Webview widget wrapper
The webview module wraps the webview widget provided by luakit, adding several convenience APIs and providing basic functionality.
Functions
webview.methods.scroll (view, w, new)
Scroll the current webview by a given amount.
Parameters
-
viewType: widgetThe webview widget to scroll.
-
wType: tableThe window class table for the window containing
view
. -
newType: tableTable of scroll information.
webview.new (opts)
Create a new webview instance.
Parameters
-
optsType: tableTable of options. Currently only
private
is recognized as a key.
Return Values
-
tableThe newly-created webview widget.
webview.window (view)
Wrapper for window.ancestor
.
Parameters
-
viewType: widgetThe webview whose ancestor to find.
Return Values
-
table or nilThe window class table for the window that contains
view
, ornil
ifview
is not contained within a window.
webview.modify_load_block (view, name, enable)
Add/remove a load block on the given webview. If a block is enabled on a webview, load requests will be suspended until the block is removed. This is useful for pausing network operations while a module is initializing.
Parameters
-
viewType: widgetThe view on which to add/remove the load block.
-
nameType: stringThe name of the block to add/remove.
-
enableType: booleanWhether the block should be enabled.
webview.has_load_block (view)
Check whether the given webview has a load block.
Parameters
-
viewType: widgetThe webview.
Return Values
-
boolean
true
if the given webview has a load block.
webview.set_location (view, arg)
Set the location of the webview. This method will respect any load blocks in
place (see modify_load_block
).
Parameters
-
viewType: widgetThe view whose location to modify.
-
argType: tableThe new location. Can be a URI, a JavaScript URI, or a table with
session_state
anduri
keys.
Properties
webview.methods
Type: {[string]=function}
Read-write
These methods are present when you index a window instance and no window
method is found in
window.methods
. The window then checks if there is an
active webview and calls the following methods with the given view instance
as the first argument. All methods must take view
& w
as the first two
arguments.
Attribution
Copyright
- 2017 Aidan Holm
- 2012 Mason Larobina