File tree 1 file changed +18
-5
lines changed
1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -305,10 +305,16 @@ final class DatabaseClient implements WebSqlite {
305
305
306
306
Future <void > _startDedicated () async {
307
307
if (globalContext.has ('Worker' )) {
308
- final dedicated = Worker (
309
- workerUri.toString ().toJS,
310
- WorkerOptions (name: 'sqlite3_worker' ),
311
- );
308
+ final Worker dedicated;
309
+ try {
310
+ dedicated = Worker (
311
+ workerUri.toString ().toJS,
312
+ WorkerOptions (name: 'sqlite3_worker' ),
313
+ );
314
+ } on Object {
315
+ _missingFeatures.add (MissingBrowserFeature .dedicatedWorkers);
316
+ return ;
317
+ }
312
318
313
319
final (endpoint, channel) = await createChannel ();
314
320
ConnectRequest (endpoint: endpoint, requestId: 0 ).sendToWorker (dedicated);
@@ -322,7 +328,14 @@ final class DatabaseClient implements WebSqlite {
322
328
323
329
Future <void > _startShared () async {
324
330
if (globalContext.has ('SharedWorker' )) {
325
- final shared = SharedWorker (workerUri.toString ().toJS);
331
+ final SharedWorker shared;
332
+ try {
333
+ shared = SharedWorker (workerUri.toString ().toJS);
334
+ } on Object {
335
+ _missingFeatures.add (MissingBrowserFeature .sharedWorkers);
336
+ return ;
337
+ }
338
+
326
339
shared.port.start ();
327
340
328
341
final (endpoint, channel) = await createChannel ();
You can’t perform that action at this time.
0 commit comments