processing / processing/p5.js-web-editor

Offline mode - Service workers

Open
#813 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request Priority:Medium
Dominant language
JavaScript
Stars
1.7k
Forks
1.7k
Avg merge
3d 4h
Merged PRs (30d)
8

Description

I've just been trying to add a service worker to try and make a PWA in the P5js Editor.
https://editor.p5js.org/hellonearthisman/sketches/fwp_5jja3 has the code to setup the service worker. I tried putting the code in the index.html and in the sketch setup.
I get this error (seen in console in present mode https://editor.p5js.org/hellonearthisman/present/fwp_5jja3 )

Service worker registration failed: TypeError: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script.

Any tips on how to get this to work or why it won't work are welcome.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using the linked sketch and its present-mode URL, then inspect the browser console and the service-worker script request that returns 404. Determine what the editor must provide for service-worker registration to work in offline mode; done means the worker registers successfully without the 404.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.