Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sw example (chromium now supports cancel event notifications to service workers) #65

Open
alex737876 opened this issue Sep 12, 2023 · 2 comments

Comments

@alex737876
Copy link

alex737876 commented Sep 12, 2023

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?

@jimmywarting
Copy link
Owner

Yea, are you willing to send a PR?

@alex737876
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants