Skip to content
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

Notify Users for the failure in loading Image via external URL #1813

Merged
merged 7 commits into from
Feb 19, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/lib/defaultHtmlStepUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function DefaultHtmlStepUi(_sequencer, options) {
<div class="col-md-8 cal collapse in step-column">\
<div class="load load-spin" style="display:none;"><i class="fa fa-circle-o-notch fa-spin"></i></div>\
<div class="step-image">\
<a class="cal collapse in"><img class="img-thumbnail step-thumbnail"/></a>\
<a class="cal collapse in"><img class="img-thumbnail step-thumbnail" crossorigin="anonymous" /></a>\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this the only thing missing? It was working before but maybe browsers increased security requirements? Wow!

Do you think we can still run a test for this? We could pull in a remote image from a static source and use looks-same to compare it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok sir i will try to run this one.
BTW i have one more approach to tackle this problem. We can create a local directory and once we place a url to load the image we can use that url to download the image in that directory and can render image directly from local folder this will remove the overhead of cross-origin.
What's your view?

Copy link
Author

@vivek-30 vivek-30 Feb 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually previously this was the error in the console when image failed to load-

Uncaught Security Error: Failed to execute ‘toDataURL’ on ‘HTMLCanvasElement’: tainted canvases may not be exported.

But after setting crossorigin=anonymous this error disappeared.

</div>\
</div>\
</div>\
Expand Down