Update sw example (chromium now supports cancel event notifications to service workers)
alex737876 opened this issue · comments
alex737876 commented
In the /master/example/sw.js cancel() method:
/** @param {Error} reason */
cancel (reason) {
// Firefox can notify a cancel event, chrome can't
// https://bugs.chromium.org/p/chromium/issues/detail?id=638494
this.port.postMessage({ type: ERROR, reason: reason.message })
this.port.close()
}
There is a link to a chromium bug, that is fixed now (since Jan 2022).
Maybe the example sw could now be simplified?
Jimmy Wärting commented
Yea, are you willing to send a PR?
alex737876 commented
Yes, right now im struggling to get the service worker running, so that i can try removing that "cancel() function". Its downloading everything into memory before opening a file save dialog on iOS. But ive placed the script not in src root, that i will try next. To keep you posted