Cross-origin error with photon
-
Console:
Image from origin 'https://i0.wp.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://mysite.com' is therefore not allowed access.
DOM:
<img width="960" height="750" src="https://i0.wp.com/mysite.com/wp-content/uploads/2015/11/worked_Boy-Next-Door.jpg?resize=960%2C750" class="scale-with-grid wp-post-image BWFilter BWfade" alt="Worked on Boy Next Door Movie" itemprop="image" crossorigin="anonymous" style="top: 0px; left: 0px; position: absolute; transform: translate3d(0px, 0px, 0px); opacity: 1; -webkit-filter: grayscale(100%);">
However, this DOM element (exact same image) IS loading:
<img width="960" height="750" src="https://i0.wp.com/mysite.com/wp-content/uploads/2015/11/worked_Boy-Next-Door.jpg?resize=960%2C750" class="scale-with-grid wp-post-image" alt="Worked on Boy Next Door Movie" itemprop="image" crossorigin="anonymous">
The site loads 2 (identical src) img elements into the DOM for a greyscale hover effect. The first image has the greyscale filter applied which has nothing to do with cross-origin specification but produces the console error. The second img element is visible and loads without the cross-origin error.
Haven’t looked into whether this is a browser bug (seems very likely) but thought I’d report this “odd behavior”. Tested in Chrome Version 47.0.2526.111 m
- The topic ‘Cross-origin error with photon’ is closed to new replies.