Skip to content

feature | add useWebview handler for client #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
programmernb-ctrl opened this issue Apr 6, 2025 · 0 comments
Open

feature | add useWebview handler for client #32

programmernb-ctrl opened this issue Apr 6, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@programmernb-ctrl
Copy link
Owner

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
@programmernb-ctrl programmernb-ctrl self-assigned this Apr 6, 2025
@programmernb-ctrl programmernb-ctrl added the enhancement New feature or request label Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant