最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - On Firefox, CORS request gives error ":" (colon) - Stack Overflow

programmeradmin2浏览0评论

On Chrome, I'm having no troubles making a cross domain request, however on Firefox (Ubuntu 14.04), I get an error that consists only of a colon on the line that calls for the xmlhttprequest.

xmlhttp.open("GET", "http://x.x.x.x:xxxx/folder/file.xml", false);

The error message is just ":".

On Chrome, I'm having no troubles making a cross domain request, however on Firefox (Ubuntu 14.04), I get an error that consists only of a colon on the line that calls for the xmlhttprequest.

xmlhttp.open("GET", "http://x.x.x.x:xxxx/folder/file.xml", false);

The error message is just ":".

Share Improve this question edited Aug 11, 2014 at 14:37 Matt asked Aug 11, 2014 at 14:28 MattMatt 12710 bronze badges 6
  • What, exactly is the error message? – Quentin Commented Aug 11, 2014 at 14:33
  • ":". I have no idea why it just gives me that. – Matt Commented Aug 11, 2014 at 14:34
  • Can you show us the code you're using to detect errors? – Halcyon Commented Aug 11, 2014 at 14:38
  • It's the Firefox console. – Matt Commented Aug 11, 2014 at 14:41
  • In a similar situation I am getting the same issue with Firefox; debugging with Firebug and the built in tools. I changed my url from domain/professional/etc to domain/admin/etc and the error popped up. The error is simply a colon, the line of code is the one that opens the request. This does not occur in Chrome. I am currently using Firefox 32 Beta. – Adam Dally Commented Aug 15, 2014 at 2:47
 |  Show 1 more ment

4 Answers 4

Reset to default 8

Try Disabling AdBlock

I was having a similar issue where all of my XMLHttpRequests were going through except for a few very specific ones where even minor URL changes fixed the problem. And the only thing I was getting was a colon : in the console. In the end I realized that AdBlockPlus was blocking at least one these requests from going through (the request had 'Banners' in the URL).

So I'm not sure if this would have solved your problem, but I've encountered it multiple times.

using Firebug, the issue turned out to be

Blocked loading mixed active content

I had the same error on a CORS POST request. I'm using https://cors-anywhere.herokuapp./ to bypass the Same-origin policy. The problem was NoScript blocking the external domain, so in case you're using an external API in your request, this might solve it.

Same as this answer, however the problem for me isn't present neither with AdBlock nor with uBlock.

It's present with uMatrix.

You can find that it blocks the request at this URL:

chrome://umatrix/content/logger-ui.html

You can enable it manually when clicking on that field:

and choosing to enable XHR in the uMatrix popup:

The blocking persists even if you have the code packaged in an Add-on that's correctly installed (the blue bar containts Internal UUID of a Firefox Add-on), therefore if you've ever wondered why some Add-ons don't work while uMatrix (or likes) is enabled, this might be one of the reasons.

发布评论

评论列表(0)

  1. 暂无评论