Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const scriptModule = { exports: {} };
const context = Object.assign(globalScope, {
Cache,
CacheStorage,
Client,
Clients,
ExtendableEvent,
FetchEvent,
FormData,
Headers,
IDBCursor: FDBCursor.default,
IDBCursorWithValue: FDBCursorWithValue.default,
IDBDatabase: FDBDatabase.default,
IDBFactory: FDBFactory.default,
IDBIndex: FDBIndex.default,
IDBKeyRange: FDBKeyRange.default,
IDBObjectStore: FDBObjectStore.default,
IDBOpenDBRequest: FDBOpenDBRequest.default,
IDBRequest: FDBRequest.default,
IDBTransaction: FDBTransaction.default,
IDBVersionChangeEvent: FDBVersionChangeEvent.default,
MessageChannel,
MessageEvent,
MessagePort,
navigator: {
connection: 'not implemented',
online: true,
permissions: 'not implemented',
storage: 'not implemented',
userAgent: 'sw-test-env'
},
Notification,