Thanks again for all your help. Just to let you know I have found a solution to using Web Workers in OpenProcesing.
- The web worker code file should be a code tab rather than imported into files
- Mark all code tabs as javascript by adding the
.jsextension. This includes the web worker file. - choose the HTML/CSS/JS mode.
- in
index,htmladd script tags for all your code files except the web worker. - in
index.htmladd script tags for p5js and any third party libraries used.
I have used this in my “Train Tracks” sketch (see below) which uses a web worker to create new puzzles.