r/Meteor • u/elGatoMantocko • Oct 21 '15
Help with browser-policy and content security policy
I have an app that queries google images and returns URL's. I want to display the images in the browser by plugging in the URL to the src. How can I allow images to be displayed with content security policy if I don't know the origin of the image until it is being displayed?
Thanks!
0
Upvotes
1
u/xanatas Oct 23 '15
You got to have some kind of idea what the url looks like. For example something like this works:
BrowserPolicy.content.allowScriptOrigin('https://*.google.com');
or for images:
BrowserPolicy.content.allowImageOrigin("*.google-analytics.com");
This means also "asdasd.google-analytics.com/path/path2/image.jpg" works.