goinnn / cordova-plugin-airgap-webview

Web View plugin for Cordova, specialized for Ionic apps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AirGap Web View for Cordova

This is a fork of the Ionic WKWebView cordova plugin, removing the internal webserver and serving the files directly from the local filesystem in order to ensure proper sandboxing.

Migration

LocalStorage

The localStorage and IndexedDB of the ionic-webview will not be accessible after the switch to this plugin. If you use @ionic/storage and the sqlite driver, then you will not be affected by this.

WebWorkers

WebWorkers cannot be loaded from the filesystem directly. As a workaround, they have to be inlined and loaded as a string/blob. So instead of this:

worker.js

self.onmessage = function (event) {
  // worker code
}
const worker = new Worker('./assets/workers/worker.js')

You will have to do this:

worker.js

const workerJS = `
self.onmessage = function (event) {
  // worker code
}
`

export default workerJS
import workerJS from '../../assets/workers/worker'
const blobURL = window.URL.createObjectURL(new Blob([workerJS]))
const entropyCalculatorWorker = new Worker(blobURL)

Others

There might be other issues that we are not aware of. Please test your app thoroughly after switching to this plugin and report any errors here.

About

Web View plugin for Cordova, specialized for Ionic apps.

License:Apache License 2.0


Languages

Language:Objective-C 83.1%Language:JavaScript 16.9%