setAllowContentAccess static method

Future<void> setAllowContentAccess(
  1. bool allow
)

Enables or disables content URL access from Service Workers. This method should only be called if AndroidWebViewFeature.isFeatureSupported returns true for AndroidWebViewFeature.SERVICE_WORKER_CONTENT_ACCESS.

NOTE: available on Android 24+.

Official Android API: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#setAllowContentAccess(boolean)

Implementation

static Future<void> setAllowContentAccess(bool allow) async {
  await ServiceWorkerController.setAllowContentAccess(allow);
}