Skip to content

feature | add useWebview handler for client #32

Closed
@programmernb-ctrl

Description

@programmernb-ctrl

useWebview

Currently we are building a "idk i call it handler 😂" for handling certain actions regarding the webview
we'll surely expand it by time but here are some existing methods you'll be able to use soon

import {useWebview} from './useWebview' // Client

const Webview = useWebview();

Webview.page // string - this is the same as Webview.currPage
Webview.pages // string[] - existing pages
Webview.currPage // string - current page
Webview.isFocused // boolean  - whether the webview is focused or not
Webview.setPage("pageNameInRouter") // set the page and our router will directly route to the page
Webview.focus() // sets the focus to the webview
Webview.focused() // returns the Webview.isFocused value
Webview.unfocus() // checks if the nui is focused and sets the focus to false

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions