任何主流浏览器中是否都有内置的 HTML 验证器?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5615088/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there a built-in HTML validator in any major browser?
提问by Xah Lee
In Firefox, there's a Extension called “Html Validator”. It adds a little indicator icon at the bottom right corner of your window. When a page you visit isn't valid, it lights up. You can click on it to see the errors. The really important feature of this extension is that it does not make a connection to w3c's validator. The same validating SGML parser used by w3c is bundled. This means it can validate local HTML files. (This is most the important use for me, as I do web development with manually coded html files. Each time I preview my HTML in a browser, I can also know whether it has validation errors.)
在 Firefox 中,有一个名为“Html Validator”的扩展。它在窗口的右下角添加了一个小指示器图标。当您访问的页面无效时,它会亮起。您可以单击它以查看错误。这个扩展真正重要的特性是它没有连接到 w3c 的验证器。捆绑了 w3c 使用的相同验证 SGML 解析器。这意味着它可以验证本地 HTML 文件。(这对我来说是最重要的用途,因为我使用手动编码的 html 文件进行 Web 开发。每次我在浏览器中预览我的 HTML 时,我也可以知道它是否有验证错误。)
Is there anything similar in Google Chrome, Opera, Safari, or even IE? When I looked in the past years, all other validator I've seen simply send the current url to w3c's validator site.
Google Chrome、Opera、Safari 甚至 IE 中是否有类似的东西?当我查看过去几年时,我看到的所有其他验证器都只是将当前 url 发送到 w3c 的验证器站点。
回答by mgueury
I am the author of the Firefox extension. I have recently rewritten it for Chrome and the new Webextension API of Firefox.
我是 Firefox 扩展的作者。我最近为 Chrome 和 Firefox 的新 Webextension API 重写了它。
See more info on the extension homepage:
在扩展主页上查看更多信息:
The direct link from the Google Chrome store is this:
Google Chrome 商店的直接链接是这样的:
https://chrome.google.com/webstore/detail/html-validator/mpbelhhnfhfjnaehkcnnaknldmnocglk
https://chrome.google.com/webstore/detail/html-validator/mpbelhhnfhfjnaehkcnnaknldmnocglk
Enjoy,
享受,
回答by Tim
There is a new HTML validator available for Chrome. It uses a JavaScript port of LibTidy and thus validates locally without the need of remote services.
有一个适用于 Chrome 的新 HTML 验证器。它使用 LibTidy 的 JavaScript 端口,因此无需远程服务即可在本地进行验证。
See https://chrome.google.com/webstore/detail/anjdemaoejlpgmnmkijdemoiebcddhkc
请参阅https://chrome.google.com/webstore/detail/anjdemaoejlpgmnmkijdemoiebcddhkc
回答by yitwail
The HTML Tidy Browser Extension works quite well, although it doesn't have as many features as the Firefox counterpart. As an added bonus, it works on localhost pages. You can get it here: https://chrome.google.com/webstore/detail/html-tidy-browser-extensi/gljdonhfjnfdklljmfaabfpjlonflfnm
HTML Tidy Browser Extension 工作得很好,尽管它没有 Firefox 对应的那么多功能。作为一个额外的好处,它适用于本地主机页面。你可以在这里得到它:https: //chrome.google.com/webstore/detail/html-tidy-browser-extensi/gljdonhfjnfdklljmfaabfpjlonflfnm
回答by Mark Cidade
HTML Validator by Robert Nymanfor Google Chrome has an indicator icon, displays inline results, and validates local files.
Robert Nyman为 Google Chrome 开发的HTML Validator有一个指示器图标,显示内联结果,并验证本地文件。
回答by Mark Cidade
I don't think that type of thing is usually built in, because they aren't needed by the average user and can slow down your browsing. Generally speaking, add-ons are the way to go, in my humble opinion.
我不认为这种类型的东西通常是内置的,因为普通用户不需要它们并且会减慢您的浏览速度。一般来说,在我看来,附加组件是要走的路。
The top two browser additions for anyone who is developing any website are: Firebug (as mentioned by a previous response) and the Web Developer toolbar, available for many browsers. Here is a link to the developer's page for the toolbar: Website for Web Developer Toolbar
对于开发任何网站的任何人来说,最重要的两个浏览器新增功能是:Firebug(如之前的回复所述)和 Web Developer 工具栏,可用于许多浏览器。这是工具栏的开发人员页面的链接:Web Developer Toolbar 网站
Firebug is great for stepping through JavaScript, detecting errors, checking out your HTML & CSS, as well as a plethora of other useful features.
Firebug 非常适合单步调试 JavaScript、检测错误、检查 HTML 和 CSS 以及大量其他有用的功能。
The Web Developer Toolbar on the other hand, allows you to Validate HTML, CSS, etc, either on a local host, or on the web, turn off Javascript, turn off CSS, plus much more!
另一方面,Web 开发人员工具栏允许您在本地主机或 Web 上验证 HTML、CSS 等,关闭 Javascript、关闭 CSS 等等!
I hope this helps!
我希望这有帮助!
回答by zx1986
I am using this plugin in Chrome:
https://github.com/renyard/validity
我在 Chrome 中使用这个插件:https:
//github.com/renyard/validity
Simple enough to use.
But I think there will be better to have a native tool in Chrome / Firefox.
使用起来足够简单。
但我认为在 Chrome / Firefox 中有一个原生工具会更好。