-
-
Notifications
You must be signed in to change notification settings - Fork 679
Open
Description
As XMLHttpRequest is not available in service worker environment, the code below throws Uncaught (in promise) ReferenceError: XMLHttpRequest is not defined
error and the sync state becomes broken. This method is triggered when tryUseServiceWorker: true
and there is a blob property in the table.
export function readBlobSync(b) {
const req = new XMLHttpRequest();
req.overrideMimeType("text/plain; charset=x-user-defined");
req.open("GET", URL.createObjectURL(b), false); // Sync
req.send();
if (req.status !== 200 && req.status !== 0) {
throw new Error("Bad Blob access: " + req.status);
}
return req.responseText;
}
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status