view-source URI方案是部分网页浏览器采用的一种特殊URL,功效是显示指定资源的源代码。[1]
举例来说,显示URI为 http://www.example.com(页面存档备份,存于互联网档案馆) 的页面源代码只需使用:view-source:http://www.example.com
2011年5月25日,“view-source”URI方案在IANA[2]按RFC 4395正式注册。
浏览器支持[编辑]
| 此条目需要更新。 (2021年1月30日) 请更新本文以反映近况和新增内容。完成修改后请移除本模板。 |
Mozilla Firefox和Internet Explorer两者支持此方案,不过Internet Explorer自Windows XP SP2开始因安全原因停止支持。[3]Firefox也遇到了类似的安全问题(结合view-source和javascript URI[4]),但在问题修复后于Firefox 1.5[5]中继续支持。
参考资料[编辑]
- ^ IETF Draft
- ^ Yevstifeyev, M. 'view-source' URI scheme registration template. [17 July 2011]. (原始内容存档于2022-05-13).
- ^ view-source Protocol. MSDN. [2009-02-25]. (原始内容存档于2017-09-01).
- ^ mikx. Mozilla Firefox view-source:javascript url Code Execution Exploit. milw0rm. 2005-05-21 [2009-02-25]. (原始内容存档于2007-08-14).
- ^ jonathan. View Source Bug Fixed and a Tip. blogzilla. 2005-11-30 [2009-02-25]. (原始内容存档于2021-04-13).
- ^ Firefox 47 for developers. [2016-06-28]. (原始内容存档于2018-07-07).
- ^ Lifehacker - Google Chrome's Full List of Special about: Pages. [2016-06-28]. (原始内容存档于2013-06-27).
- ^ Robitaille, Jason. Internalz 1.3 brings style with a dark theme and more. PreCentral. 2010-08-28 [2011-02-11]. (原始内容存档于2011-05-12).