I am integrating the face-api.js into C3 as a plugin, but I am having an issue with preview. It works fine with the export of game to HMTL5 and hosted (locally or on a remote server.) It also works fine when exported with Electron and run as a desktop app (https://electronforconstruct.armaldio.xyz/).
The issue occurs when the JS api requests a file via a fetch URI (that's included in the root of the plugin and the root of the exported HTML5.) The error on the Chrome console is:
Access to fetch at 'https://editor.construct.net/r151/preview/ssd_mobilenetv1_model-weights_manifest.json'
from origin 'https://preview.construct.net' has been blocked by CORS policy:
No 'Access-Control-Allow-Origin' header is present on the requested resource.
If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch
the resource with CORS disabled.
However, preview fails any suggestions? Is it possible to enable CORS between preview.construct.net and editor.construct.net or is that a security issue for construct.net?