Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
"Unsafe attempt to load URL from frame" #16
I am having trouble referencing an external SVG hosted by a CDN. It looks like some kind of CORS issue. Here's the error that Chrome and Safari throw:
Firefox just fails silently.
I'm loving using
I hit this problem as well when trying to serve an SVG sprite from a CDN. First, there is a fundamental problem: The
There is a PARTIAL workaround: configure the CDN to handle CORS (CloudFront instructions, Heroku/Rails instructions) and then instruct svg4everybody to use AJAX to load the remote svg asset by setting polyfill to true:
While that will successfully load the remote resource, it won't stop the browser from throwing an error about "Unsafe attempt to load URL" for every instance of
After going through all those steps I ended up just serving my SVG sprite directly from the server rather than from the CDN. Sometimes the simplest solution is the best.
referenced this issue
Apr 17, 2017
For anyone who's wondering - https://css-tricks.com/ajaxing-svg-sprite/
From the article:
Just pasting it just in case anyone encounters the same issue!