• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2202
  • Last Modified:

Can't find source of error: Cross-Origin Request Blocked:

I get this message in firebug:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://themes.googleusercontent.com/static/fonts/opensans/v8/u-WUoqrET9fUeobQW7jkRT8E0i7KZn-EPnyo3HZu7kw.woff. This can be fixed by moving the resource to the same domain or enabling CORS.

However there is no reference in the code to googleusercontent.com.    I do a text search of the entire site and "googleuser" doesn't show up.   There is no line number in firebug to indicate the location of the error.   I can't fix an error if I can't find it in the code.  Adding the resource won't do any good unless I can figure out what uses it.  

Is there any way to track down what could be using this code in my site?
0
vrosas_03
Asked:
vrosas_03
  • 3
  • 2
  • 2
  • +1
6 Solutions
 
GaryCommented:
Are you using Google Fonts?
Is this in Chrome, FF ... ? What version?
0
 
Ray PaseurCommented:
See the part about "Relaxing the same-origin policy" here:
http://en.wikipedia.org/wiki/Same-origin_policy

Some of the rationale and implementation details:
http://www.html5rocks.com/en/tutorials/security/content-security-policy/

See also:
https://bugzilla.mozilla.org/show_bug.cgi?id=604421 (search for "woff")

This looks a little promising:
https://bugzilla.mozilla.org/show_bug.cgi?id=604421#c30
0
 
RobOwner (Aidellio)Commented:
Check the css files you've included as that will be where those fonts are referenced. However,
It is most likely in a JavaScript script as cross domain it's only a problem with Ajax that I'm sure css doesn't have an issue with.
What js are you including and what css?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
vrosas_03Author Commented:
It was in firefox firebug that this error showed up.  I think i found it eventually by commenting out one line here and one line there till I narrowed it down to the line that was causing it.   It turned out to be a css file which accessed google somehow.   I don't know why it didn't show up in a text search.
0
 
GaryCommented:
See my first comment, you must be referencing a Google font and unless you are using @font-face you may encounter this error
0
 
Ray PaseurCommented:
don't know why it didn't show up in a text search
It wouldn't be expected to show up unless you made a search of every included and linked file in the HTML document.  Want to write an article for E-E that will get a lot of hits?  Write one that teaches how to search an HTML document recursively, following all the links to ground, searching for a string in the HTML, and in every CSS, JS, etc.

Assuming you fixed it, how did you overcome the issue?
0
 
RobOwner (Aidellio)Commented:
This all gets back to what Gary posted in his first comment.
if JavaScript has modified the css after the page had loaded by referencing content on the Google fonts domain then it won't be allowed.
0
 
vrosas_03Author Commented:
I figured it out.  Don't have time to explain why.  I have the ability to search the text  of every single file in the directory.  I figured it out by commenting out every css link until i narrowed it down to the one that was causing the problem.  I can't remember if the url was actually in that file but I think it was.
0
 
vrosas_03Author Commented:
I use Agent Ransack so if that doesn't manage to get all the text in a directory and all it's subdirectories maybe that's why it didn't find it.  but it seems to be pretty thorough.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now