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
fix(sab): check for sab before using it #648
Conversation
✅ Deploy Preview for cornerstone-3d-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
CC @Ouwen I think this is what you were talking in the office hours |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost there...
// we need to identify if the target buffer is a SharedArrayBuffer | ||
// since inside the webworker we don't have access to the window | ||
// to say if it is a SharedArrayBuffer or not with instanceof | ||
options.isSharedArrayBuffer = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is still not correct. it should be...
options.isSharedArrayBuffer =
options.targetBuffer.arrayBuffer &&
options.targetBuffer.arrayBuffer instanceof SharedArrayBuffer;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Approved.
Context
SAB requires a secure context, and stack viewport can work without it (although MPR still needs a secure context https and CORS headers to work), but this will solve making the viewer actually work in the stack viewport at least.
https://community.ohif.org/t/dicom-images-infinite-loading/831/2?u=jbocce
Changes & Results
Check for SAB before using it
Testing
Run viewer against an unsecure context (localhost is secure by design), run it against an ip
Checklist
PR
semantic-release format and guidelines.
Code
[] My code has been well-documented (function documentation, inline comments,
etc.)
[] I have run the
yarn build:update-api
to update the API documentation, and havecommitted the changes to this PR. (Read more here https://www.cornerstonejs.org/docs/contribute/update-api)
Public Documentation Updates
additions or removals.
Tested Environment