worker property

Future<Worker?> worker

If the target is not of type "service_worker" or "shared_worker", returns null.

Implementation

Future<Worker?> get worker async {
  if (!const ['service_worker', 'shared_worker'].contains(_info.type)) {
    return null;
  }
  _workerFuture ??=
      _sessionFactory(isAutoAttachEmulated: false).then((client) async {
    return Worker(client, _info.url,
        onConsoleApiCalled: null, onExceptionThrown: null);
  });
  return _workerFuture;
}