Webview Plugins can be used to create all kinds of interfaces using HTML and JS.
Create a Webview
You can only create one webview per slot.
// Create a panel that appears below the home screen toolbarconstpanel=ctx.newWebview({slot:"after-home-screen-toolbar",fullWidth:true,autoHeight:true,})
Options
interfaceWebviewOptions{slot:"screen"|"fixed"|"after-home-screen-toolbar"|"home-screen-bottom"|"schedule-screen-top"|"schedule-screen-bottom"|"anime-screen-bottom"|"after-anime-entry-episode-list"|"after-anime-episode-list"|"before-anime-entry-episode-list"|"manga-screen-bottom"|"manga-entry-screen-bottom"|"after-manga-entry-chapter-list"|"after-discover-screen-header"|"after-media-entry-details"|"after-media-entry-form" // Iframe optionsclassName?:stringstyle?:stringwidth?:stringheight?:stringmaxWidth?:stringmaxHeight?:stringzIndex?:number // Iframe height is automatically adjusted to fit the webview contentautoHeight?:boolean // Iframe width takes the entire available widthfullWidth?:booleanhidden?:boolean // Applies when slot = "screen"sidebar?:{label:string,icon:string,} // Applies when slot = "fixed"window?:{draggable?:booleandefaultX?:numberdefaultY?:numberdefaultPosition?:"top-left"|"top-right"|"bottom-left"|"bottom-right"frameless?:boolean}}
Screen Slot
A Webview created with the slot screen will be rendered in its own page.
Fixed Slot
Events
Rendering
HTML
Messages
Example
This example uses Preact, a lightweight React alternative suitable for webviews.
webview.onMount(() => {
// Webview has been mounted on the screen
})
webview.onUnmount(() => {
// Webview has been unmounted
})
webview.onLoad(() => {
// Webview content has been loaded (after mount)
})
// Force the webview content to update
webview.update()
// Returns the path to the webview screen
webview.getScreenPath() // /webview?id=my-plugin
webview.hide()
webview.show()