
Security News
n8n Tops 2025 JavaScript Rising Stars as Workflow Platforms Gain Momentum
n8n led JavaScript Rising Stars 2025 by a wide margin, with workflow platforms seeing the largest growth across categories.
@essent/nativescript-webview-ext
Advanced tools
Extended WebView for NativeScript which adds 'x-local' scheme for local-files. events between WebView and native-layer, javascript execution, injecting CSS and JS-files.
Extended WebView for NativeScript which adds "x-local"-custom-scheme for loading local-files, handle events between WebView and NativeScript, JavaScript execution, injecting CSS and JS-files. Supports Android 19+ and iOS9+.
NOTE: This extends and updates the excellent: https://github.com/Notalib/nativescript-webview-ext
npm install @essent/nativescript-webview-ext
x-local:// to the webview for loading of resources inside the webview.
executeJavaScript(code: string) for executing JavaScript-code and getting result.executePromise(code: string) for calling promises and getting the result.getTitle() returns document.title.NativeScript and WebView
NativeScript to WebViewWebView to NativeScriptcss- and javascript-files.
alert, confirm and prompt with WkWebView.Android SDK 19 is required, update App_Resources/Android/app.gradle:
android {
defaultConfig {
minSdkVersion 19 // change this line
generatedDensities = []
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
Load in template like this:
<Page class="page" xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:essent="@essent/nativescript-webview-ext">
<ActionBar class="action-bar">
<Label class="action-bar-title" text="Home"></Label>
</ActionBar>
<essent:WebViewExt src="https://nota.dk"></<essent:WebViewExt>
</Page>
Import WebViewExtModule from @essent/nativescript-webview-ext/angular and add it to your NgModule.
This registers the element WebViewExt. Replace the <WebView> tag with <WebViewExt>
Import @essent/nativescript-webview-ext/vue in your app entry file (likely app.js or main.js).
This registers the element WebViewExt. Replace the <WebView> tag with <WebViewExt>
The custom-scheme handler for x-local:// is only supported by Android and iOS 11+
Custom-scheme support for iOS <11 was removed because of ITMS-90809.
| Property | Value | Description |
|---|---|---|
| readonly supportXLocalScheme | true / false | Is x-local:// supported? True on iOS >= 11 or Android, False on iOS < 11. |
| src | Load src | |
| autoInjectJSBridge | true / false | Should the window.nsWebViewBridge be injected on loadFinishedEvent? Defaults to true |
| builtInZoomControls | true / false | Android: Is the built-in zoom mechanisms being used |
| cacheMode | default / no_cache / cache_first / cache_only | Android: Set caching mode. |
| databaseStorage | true / false | Android: Enable/Disabled database storage API. Note: It affects all webviews in the process. |
| debugMode | true / false | Android: Enable chrome debugger for webview on Android. Note: Applies to all webviews in App |
| displayZoomControls | true / false | Android: displays on-screen zoom controls when using the built-in zoom mechanisms |
| domStorage | true / false | Android: Enable/Disabled DOM Storage API. E.g localStorage |
| scrollBounce | true / false | iOS: Should the scrollView bounce? Defaults to true. |
| supportZoom | true / false | Android: should the webview support zoom |
| viewPortSize | false / view-port string / ViewPortProperties | Set the viewport metadata on load finished. Note: WkWebView sets initial-scale=1.0 by default. |
| limitsNavigationsToAppBoundDomains | false | iOS: allows to enable Service Workers Note: If set to true, WKAppBoundDomains also should be set in info.plist. |
| Function | Description |
|---|---|
| loadUrl(src: string): Promise | Open a URL and resolves a promise once it has finished loading. |
| registerLocalResource(resourceName: string, path: string): void; | Map the "x-local://{resourceName}" => "{path}". |
| unregisterLocalResource(resourceName: string): void; | Removes the mapping from "x-local://{resourceName}" => "{path}" |
| getRegisteredLocalResource(resourceName: string): void; | Get the mapping from "x-local://{resourceName}" => "{path}" |
| loadJavaScriptFile(scriptName: string, filepath: string) | Inject a javascript-file into the webview. Should be called after the loadFinishedEvent |
| loadStyleSheetFile(stylesheetName: string, filepath: string, insertBefore: boolean) | Loads a CSS-file into document.head. If before is true, it will be added to the top of document.head otherwise as the last element |
| loadJavaScriptFiles(files: {resourceName: string, filepath: string}[]) | Inject multiple javascript-files into the webview. Should be called after the loadFinishedEvent |
| loadStyleSheetFiles(files: {resourceName: string, filepath: string, insertBefore: boolean}[]) | Loads multiple CSS-files into the document.head. If before is true, it will be added to the top of document.head otherwise as the last element |
| autoLoadJavaScriptFile(resourceName: string, filepath: string) | Register a JavaScript-file to be injected on loadFinishedEvent. If a page is already loaded, the script will be injected into the current page. |
| autoLoadStyleSheetFile(resourceName: string, filepath: string, insertBefore?: boolean) | Register a CSS-file to be injected on loadFinishedEvent. If a page is already loaded, the CSS-file will be injected into the current page. |
| autoExecuteJavaScript(scriptCode: string, name: string) | Execute a script on loadFinishedEvent. The script can be a promise |
| executeJavaScript(scriptCode: string) | Execute JavaScript in the webpage. Note: scriptCode should be ES5 compatible, or it might not work on 'iOS < 11' |
| executePromise(scriptCode: string, timeout: number = 500) | Run a promise inside the webview. Note: Executing scriptCode must return a promise. |
| emitToWebView(eventName: string, data: any) | Emit an event to the webview. Note: data must be stringify'able with JSON.stringify or this throws an exception. |
| getTitle() | Returns a promise with the current document title. |
| Event | Description |
|---|---|
| loadFinished | Raised when a loadFinished event occurs. args is a LoadFinishedEventData |
| loadProgress | Android only: Raised during page load to indicate the progress. args is a LoadProgressEventData |
| loadStarted | Raised when a loadStarted event occurs. args is a LoadStartedEventData |
| shouldOverrideUrlLoading | Raised before the webview requests an URL. Can cancelled by setting args.cancel = true in the ShouldOverrideUrlLoadEventData |
| titleChanged | Document title changed |
| webAlert | Raised when window.alert is triggered inside the webview, needed to use custom dialogs for web alerts. args in a WebAlertEventData. args.callback() must be called to indicate alert is closed. |
| webConfirm | Raised when window.confirm is triggered inside the webview, needed to use custom dialogs for web confirm boxes. args in a webConfirmEvent. args.callback(boolean) must be called to indicate confirm box is closed. |
| webConsole | Android only: Raised when a line is added to the web console. args is a WebConsoleEventData. |
| webPrompt | Raised when window.prompt is triggered inside the webview, needed to use custom dialogs for web prompt boxes. args in a webConfirmEvent. `args.callback(string |
| Events emitted from the webview | Raised when nsWebViewBridge.emit(...) is called inside the webview. args in an WebViewEventData |
Inside the WebView we have the nsWebViewBridge for sending events between the NativeScript-layer and the WebView.
Note: The bridge will only be available DOMContentLoaded or onload inside the WebView.
| Function | Description |
|---|---|
| window.nsWebViewBridge.on(eventName: string, cb: (data: any) => void) | Registers handlers for events from the native layer. |
| window.nsWebViewBridge.off(eventName: string, cb?: (data: any) => void) | Unregister handlers for events from the native layer. |
| window.nsWebViewBridge.emit(eventName: string, data: any) | Emits event to NativeScript layer. Will be emitted on the WebViewExt as any other event, data will be a part of the WebViewEventData-object |
window.addEventListener("ns-bridge-ready", function(e) {
var nsWebViewBridge = e.detail || window.nsWebViewBridge;
// do stuff here
});
Nota is the Danish Library and Expertise Center for people with print disabilities. To become a member of Nota you must be able to document that you cannot read ordinary printed text. Members of Nota are visually impaired, dyslexic or otherwise impaired. Our purpose is to ensure equal access to knowledge, community participation and experiences for people who're unable to read ordinary printed text.
Apache License Version 2.0
FAQs
Extended WebView for NativeScript which adds 'x-local' scheme for local-files. events between WebView and native-layer, javascript execution, injecting CSS and JS-files.
The npm package @essent/nativescript-webview-ext receives a total of 0 weekly downloads. As such, @essent/nativescript-webview-ext popularity was classified as not popular.
We found that @essent/nativescript-webview-ext demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 70 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
n8n led JavaScript Rising Stars 2025 by a wide margin, with workflow platforms seeing the largest growth across categories.

Security News
The U.S. government is rolling back software supply chain mandates, shifting from mandatory SBOMs and attestations to a risk-based approach.

Security News
crates.io adds a Security tab backed by RustSec advisories and narrows trusted publishing paths to reduce common CI publishing risks.