NavigationParams
Parameters for deciding whether top-level navigation should proceed.
import { NavigationParams } from '@mobrowser/api';
Example
import { BrowserWindow, NavigationParams } from '@mobrowser/api';
const win = new BrowserWindow()
win.browser.handle('navigation', (params: NavigationParams) => {
if (params.origin === 'https://example.com') {
return 'proceed'
}
return 'cancel'
})
Properties
url
readonly url: string;
The URL being navigated to.
origin
readonly origin: string;
The serialized origin of the URL being navigated to.
browser
readonly browser: Browser;
The browser instance performing the navigation.
isRedirect
readonly isRedirect: boolean;
Whether this navigation is a server redirect.
isRendererInitiated
readonly isRendererInitiated: boolean;
Whether the navigation was initiated by renderer content, such as a link,
form submit, or window.location assignment.
hasUserGesture
readonly hasUserGesture: boolean;
Whether the navigation was initiated with a user gesture.
isTrusted
readonly isTrusted: boolean;
Whether the destination origin is the app origin or is listed in
app.trustedOrigins in mobrowser.conf.json.
isAppControlled
readonly isAppControlled: boolean;
Whether the destination is controlled by the app, such as about:blank or
an app-registered protocol.handle() scheme.