Windows 10 reached EOS (end of support) on October 14, 2025. If you are on Windows 10, see this article.

Поиск в поддержке

Избегайте мошенников, выдающих себя за службу поддержки. Мы никогда не попросим вас позвонить, отправить текстовое сообщение или поделиться личной информацией. Сообщайте о подозрительной активности, используя функцию «Пожаловаться».

Подробнее

Firefox 3.6.13 ajax setRequestHeader('User-Agent', '...') don't work

  • 4 ответа
  • 49 имеют эту проблему
  • 24 просмотра
  • Последний ответ от dawpa2000

I did a javascript and in new Firefox version (3.6.13) don't overwrite the "User-Agent" Header in XMLHttpRequest.

Is this a new security feature? :S

The code:

jQuery.ajax({
 beforeSend: function(xhr){xhr.setRequestHeader('User-Agent', '...');},
 url: "...",
 dataType: 'xml',
 success: ...
});
I did a javascript and in new Firefox version (3.6.13) don't overwrite the "User-Agent" Header in XMLHttpRequest. Is this a new security feature? :S The code: <pre><nowiki>jQuery.ajax({ beforeSend: function(xhr){xhr.setRequestHeader('User-Agent', '...');}, url: "...", dataType: 'xml', success: ... });</nowiki></pre>

Изменено cor-el

Все ответы (4)

I'm seeing this same issue. What is the status of a patch to correct this? It has broken all our AJAX code that sets the UA to ID itself to our servers...

I experience the same. Is this indeed a new security feature (like on Chrome), or will this be patched again so it can be set again? It broke a vital component of a critical application for me.

I contacted Mozilla support for information on this bug, and they were completely useless.

I have searched and searched for more information on this bug, and this is about the only place I found this problem reported. I went into Bugzilla and searched Firefox bugs, and there is nothing about this problem.

So I have opened a new bug against Firefox to get this fixed -- https://bugzilla.mozilla.org/show_bug.cgi?id=627942

Please who are hampered by this stupid bug in Firefox can follow and comment on that bug.

Overriding the user agent is not allowed. This is not a bug.

http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader-method