electron/lib/browser/api/service-worker-main.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
493 B
TypeScript
Raw Normal View History

2025-01-31 12:40:19 -05:00
const { ServiceWorkerMain } = process._linkedBinding('electron_browser_service_worker_main');
ServiceWorkerMain.prototype.startTask = function () {
// TODO(samuelmaddock): maybe make timeout configurable in the future
const hasTimeout = false;
const { id, ok } = this._startExternalRequest(hasTimeout);
if (!ok) {
throw new Error('Unable to start service worker task.');
}
return {
end: () => this._finishExternalRequest(id)
};
};
module.exports = ServiceWorkerMain;