You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems setChemObjData launches a worker new Worker('https://unpkg.com/kekule@1.0.0/dist/extra/kekule.worker.obStructureGenerator.js') and because I use a CDN it undoubtedly fails for Cross-Origin Policy.
I know that this could be fixed simply by installing Kakule.js in my server rather than using a CDN. However, it's a bug, and I hope it could be fixed.
Thanks.
PS: there's a little mistake in tutorial, <script src="https://unpkg.com/browse/kekule@0.9.9/dist/kekule.min.js"></script> won't work, <script src="https://unpkg.com/kekule@0.9.9/dist/kekule.min.js"></script> does.
The text was updated successfully, but these errors were encountered:
Hi @crow02531, thanks a lot for your correction to the tutorial. Now it has been fixed and republished.
that worker is used for SMILES to generate atom 2D or 3D coordinates and create correct layout of molecule for displaying in chemViewer. It may be a time-consuming job for large molecules, so an extra web worker is utilized to preventing it from blocking the main thread.
To solve the your current issue, you can manually set the path of the worker, forcing it be loaded from localhost:
I load Kekule.js from CDN.
And I write down these codes in my page:
Then it yields:
It seems
setChemObjData
launches a workernew Worker('https://unpkg.com/kekule@1.0.0/dist/extra/kekule.worker.obStructureGenerator.js')
and because I use a CDN it undoubtedly fails for Cross-Origin Policy.I know that this could be fixed simply by installing Kakule.js in my server rather than using a CDN. However, it's a bug, and I hope it could be fixed.
Thanks.
PS: there's a little mistake in tutorial,
<script src="https://unpkg.com/browse/kekule@0.9.9/dist/kekule.min.js"></script>
won't work,<script src="https://unpkg.com/kekule@0.9.9/dist/kekule.min.js"></script>
does.The text was updated successfully, but these errors were encountered: