I am using fancyproductdesigner to decorate the Images....And these image hosted on s3 so when FPD try to generate the deisgned images it was giving cross origin error ..
I already made settings in s3 as recommended by them after that it works on firefox but giving errors on other browsers.
Any Help ??
We use azure blob storage with fancyproductdesigner. Found out that even though you set the CORS settings correctly on azure, we need to alter a function call in the source of fancyproductdesigner.js in the following way.
fabric.Image.fromURL(url, callback, {crossOrigin:'Anonymous'});
Please note the addition of third parameter here. This will set the image crossOrigin parameter before the image is loaded into canvas through fabric.js. The canvas will not be tainted anymore.
Related
I am trying to integrate Google Tag Manager into an Electron app,
but it doesn't seem to be working. it seems like gtm codes I planted in the app are NOT sending the analytics data anywhere.
I found this issue on Electron github repo. Seems like some people are having the same issue.
I wonder if it's impossible at all to integrate GTM on Electron, or is there any way around to do this?
[Update]
While reading Alexander Leithner's answer, a further question popped up.
on Google Tag Manager - Dev Guide - Security, it says:
While most of the tag templates in Google Tag Manager are also
protocol relative, it's important to make sure that, when setting up
custom tags to fire on secure pages, those tags are also either
protocol relative or secure.
Does file:// protocol matters because GTM is protocol relative? Wouldn't it be possible to bypass this with GA's forceSSL=true option which can be set on GTM Interface?
[Final Update]
I found the perfect answer in this blog post:
Run Google Tag Manager And Google Analytics In Local Files.
Thank you Eike Pierstorff, for giving me the hint of setting storage to none, it led me to this post.
GTM by default used to use the same protocol as the webpage - that's what "protocol relative" means. I.e. there is a bit of code that loads the GTM library, and if this uses the file protocol (as per the embedded wegpage) it will try to load the library as a file, which does not work. However GTM has switched from protocol relative to https by default, so I don't think GTM is your problem here.
You mention Analytics data, and if this refers to Google Analytics then your problem is not with GTM, it is that GA does not work on local files. Google Analytics uses a cookie to store the clientId (which is needed to aggregate individual hits into sessions/users), and since you cannot set cookies on a local file this does not work.
A possible workaround would be to go to your GA tag in GTM, to the "set fields" settings, set "storage" to "none" (which means that no cookie is set) and pass in a clientId manually.
As this comment by Samuel Attard (MarshallOfSound), who is an Electron developer, states that Google Tag Manager does not work when the including webpage is loaded using a file:// URL.
If you'd instead load your application via http:// (or more preferably via https://), you would be able to use Google Tag Manager.
I am trying to use Directus 7 in Docker and I have encountered the following problem:
I have not been able to change the API URL in the Dashboard (APP), no matter what I assign to the environment variable API_ENDPOINT or API_URL. Whenever I open the dashboard it tries to go to the url http://localhost:7000..../ping, and since the API is not found there, it fails.
Is there any way to change the API URL in the dashboard in Docker ? I am using the images: directus/api:latest and directus/app:latest
You can see the example i am using in: https://github.com/directus/docker/blob/master/examples/single-api/docker-compose.yml
Thank you for your help.
Try to clear the browser-cache or force a reload using shift+f5. had the same prob and it turned out, that the first time a fired up the container I forgot to set the desired endpoint. when reloading the browser did not update the locally cached .js file.
I'm using rasterizeHTML.js to create a canvas representing DOM elements of the webpage (such as a screenshot of the page), and then I'm passing it to texImage2d, in order to use this canvas as a texture. Althought it works fine in Firefox 21.0, in others browser (Chrome, Safari..) I get the following error:
SECURITY_ERR: DOM Exception 18: An attempt was made to break through
the security policy of the user agent.
Is there a way to bypass the security policy? I want to use it locally. I tried also to use a local webserver (MAMP) because I thought it could by due to the same origin policy but the error is the same... Thanks a lot!
The local web server is needed, but have you also made sure that all of the images you are loading are from that server, not from other origins? Use the browser's web inspector to make sure you are not loading any resources from other domains.
I am trying to create a chrome extension that calls my rails app's api. currently the api returns json and it works fine, however when I try to build it into a chrome extension, it says :
Refused to load script from 'http://mysite.com/demo?q=hello?callback=jQuery16409466155741829425_1342489669670&_=1342489677171' because of Content-Security-Policy.
I looked up the document http://code.google.com/chrome/extensions/contentSecurityPolicy.html and it sounds like I can't do this unless I implement my site into a https version. (under "Relaxing the default policy" section) I am not sure if I understood correctly and it feels ridiculous to make such a big change just because of this. Am I misunderstood? Or is there a workaround to this? Thank you.
In a Chrome extension, cross-site XMLHttpRequests are allowed, provided that you define the source in the manifest file - see http://code.google.com/chrome/extensions/xhr.html.
A JSONP implementation loads an external script using the <script> tag, and inserts it in the document. Unless the source is whitelisted through the "content_security_policy" entry, JSONP cannot be used when manifest version 2 is active (do not use manifest v1 to overcome this, because it's deprecated, and a suitable alternative already exist).
When you're unable to receive a JSON response instead of JSONP, use an ordinary request to fetch the data, cut off the callback, then parse it. Eg:
// response is the response from the server
// Received through `XMLHttpRequest`, jQuery.ajax, or whatever you used
// cuts of jQuery....( and the trailing )
response = response.replace(/^[^(]*\(/, '').replace(/\);?$/, '');
By default browsers do not allow this because of the same origin policy.
However you can get around this by making a jsonp request.
As you using jquery this super easy with getJSON method
I'm using the Facebooker plugin in Rails to publish a user action to their newsfeed, but the image isn't being added.
The call (via Net::HTTP.post_form) looks like this:
Posting to http://api.facebook.com/restserver.php with
{:api_key=>"4f5ed28f76142adsfasdf029c98ad", :template_bundle_id=>"107345673712",
:template_data=>"{\"project\": \"testing\", \"images\":
[{\"src\":\"http://www.dezyne.net/news.jpg\",
\"href\":\"http://www.facebook.com/\"}]}",
:session_key=>"2.nvhdfsdfgimDZWSwQ__.86400.1245405600-100000007614297",
:method=>"facebook.feed.publishUserAction", :sig=>"ac0a7181b351b5fdgsdfge767a004314",
:call_id=>"1242343866.44512", :v=>"1.0"}
'Project' is captured OK in the text that's posted to the newsfeed.
One possible issue is that you tested this template before actually uploading the image. This would cause Facebook to have cached an empty image. Every time the image is requested, FB uses their stored cache rather than retrieving the image all over again.
If this is the problem, the solution is to use the API function fbml.refreshImgSrc() to cause Facebook to update their cache. Unfortunately there's no quick mechanism to do this as that API method is not available in the Test Console nor through the Developer app at all, meaning you will need to write a script just to refresh the cache of this image.
If this doesn't help, post back and I'll see if I can't think of any other possible problems.