Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

Learn More

HTML displays as text only from the web

  • 4 个回答
  • 0 人有此问题
  • 1 次查看
  • 最后回复者为 Questor

more options

I have a dozen old embedded device modules (circa 2003) which can host a web page. When I access the device through my local intranet (192.168.0.xxx), the web page displays correctly. However, when the same page is accessed through my DNS service (xxx.gotdns.org:xxxx) over the web, the Firefox INSPECT:network tool indicates that the document is type:text and displays the HTML in a text format. The first line of the HTML document is :<!DOCTYPE html>.....

These devices are non-secure information-only devices, but at least Firefox allows for HTTP: exceptions.

However, I cannot understand why Firefox treats the same content differently depending on the path. Is there a way to force Firefox to actually look at the contents of the packet and treat it accordingly?

I have a dozen old embedded device modules (circa 2003) which can host a web page. When I access the device through my local intranet (192.168.0.xxx), the web page displays correctly. However, when the same page is accessed through my DNS service (xxx.gotdns.org:xxxx) over the web, the Firefox INSPECT:network tool indicates that the document is type:text and displays the HTML in a text format. The first line of the HTML document is :&lt;!DOCTYPE html&gt;..... These devices are non-secure information-only devices, but at least Firefox allows for HTTP: exceptions. However, I cannot understand why Firefox treats the same content differently depending on the path. Is there a way to force Firefox to actually look at the contents of the packet and treat it accordingly?

由cor-el于修改

被采纳的解决方案

Thanx Jeff, What threw me off-course was that browsers treated content differently. What I should have been looking at was a "simple" web site that I could capture with WireShark. It's almost impossible to find a "Simple" site.

I made some progress. The SitePlayer device (circa 2002) is just too old and does not preface a GET response with the new required information. More up-to-date servers add the following:


HTTP/1.0 200 OK Pragma: no-cache Content-Type: text/html


So, I added the proper lines to the HTML file and it loaded properly. Without access to the Siteplayer Source Code, it's the best I can do.....

定位到答案原位置 👍 0

所有回复 (4)

more options

This likely means that the web server software you are using doesn't send .htm(l) files as text/html, but sends them as text/plain like you noticed. You need to check the docs of that server software to see how to configure the server.

more options

Sorry, this doesn't explain why Firefox (even as early as 35.0.1) treats identical web pages differently depending on the network path. Attached is an image of a simple web page that worked OK locally, but not via the internet.

A. To allow off-site access to intranet devices, I use my Router Port Forwarding with a DNS server which routes requests to port 80. Any problems with this?? B. it does work on older versions of Win-7 Internet Explorer ver 11. C It doesn't work with MS Edge, something about an invalid HTTP Response, but I don't use Edge.... D. I used WireShark to capture the 2 conversations and, with the exception of the source address, the content was the same.

由Questor于修改

more options

Open the Network Monitor panel (Ctrl+Shift+E) and then load or reload the page. Click the row that has the main page request and in the pane on the right side, check the Response Headers for the Content-Type. It would make no sense for the Content-Type to be text/html in one case and text/plain in the other, but that sounds like what Firefox is receiving. What do you see?

more options

选择的解决方案

Thanx Jeff, What threw me off-course was that browsers treated content differently. What I should have been looking at was a "simple" web site that I could capture with WireShark. It's almost impossible to find a "Simple" site.

I made some progress. The SitePlayer device (circa 2002) is just too old and does not preface a GET response with the new required information. More up-to-date servers add the following:


HTTP/1.0 200 OK Pragma: no-cache Content-Type: text/html


So, I added the proper lines to the HTML file and it loaded properly. Without access to the Siteplayer Source Code, it's the best I can do.....