SmartPhoto icon indicating copy to clipboard operation
SmartPhoto copied to clipboard

For some reason it started to catch a DOMException when image is clicked

Open domjanzsoo opened this issue 4 years ago • 3 comments

Probably the exception is thrown due to a recent change I made, but I cannot find any concrete answer to what causes the following exception error. I found a stackoverflow hint that it can be a CORS restriction. Untitled

domjanzsoo avatar May 23 '21 18:05 domjanzsoo

I have the same problem. I got js and css files of 1.6.4 version from unpkg and when image is clicked I get Uncaught DOMException: Failed to execute 'replaceState' on 'History': A history state object with URL in Chrome. Firefox gives Uncaught DOMException: The operation is insecure. Could anyone say how to solve this problem? I use pure JS without jquery.

PavelTurk avatar Sep 13 '21 14:09 PavelTurk

I think my problem was that the capture data attribute on my tag was the same for every image. If you're looping through a set of images, try to set a counter variable, and after increasing this counter at each loop cycle use it to set a unique data-capture and a unique id for the actual tag. Hope that helps.

domjanzsoo avatar Sep 13 '21 20:09 domjanzsoo

@domjanzsoo @PavelTurkish Hi. This issue is caused by the browser URL and the image URL having different origin like http://localhost:8000 and https://127.0.0.1:8000. Please fix, so that the origin is the same.

uidev1116 avatar Jan 10 '23 05:01 uidev1116