View-source URI方案

本页使用了标题或全文手工转换
维基百科,自由的百科全书

view-source URI方案是部分网页浏览器采用的一种特殊URL,功效是显示指定资源的源代码。[1]

举例来说,显示URIhttp://www.example.com(页面存档备份,存于互联网档案馆) 的页面源代码只需使用:view-source:http://www.example.com

2011年5月25日,“view-source”URI方案在IANA[2]RFC 4395正式注册。

浏览器支持

Mozilla FirefoxInternet Explorer两者支持此方案,不过Internet Explorer自Windows XP SP2开始因安全原因停止支持。[3]Firefox也遇到了类似的安全问题(结合view-source和javascript URI[4]),但在问题修复后于Firefox 1.5[5]中继续支持。

浏览器 是否支持
Mozilla Firefox截止至46 支持
Mozilla Firefox自47开始 不支持[6]
Mozilla SeaMonkey 支持
Netscape 支持
Internet Explorer 456 支持
Internet Explorer 678 不支持,自Windows XP SP2起
Safari 3.2.1 支持[來源請求]
Safari 5, 6 不支持
Opera 7, 8, 9, 10, 11 不支持
Opera及更新版本 支持
Google Chrome 支持[7]
Web 支持[來源請求]
HP webOS 支持,在名为Internalz Pro的自产浏览器内[8]

参考资料

  1. ^ IETF Draft
  2. ^ Yevstifeyev, M. 'view-source' URI scheme registration template. [17 July 2011]. (原始内容存档于2022-05-13). 
  3. ^ view-source Protocol. MSDN. [2009-02-25]. (原始内容存档于2017-09-01). 
  4. ^ mikx. Mozilla Firefox view-source:javascript url Code Execution Exploit. milw0rm. 2005-05-21 [2009-02-25]. (原始内容存档于2007-08-14). 
  5. ^ jonathan. View Source Bug Fixed and a Tip. blogzilla. 2005-11-30 [2009-02-25]. (原始内容存档于2021-04-13). 
  6. ^ Firefox 47 for developers. [2016-06-28]. (原始内容存档于2018-07-07). 
  7. ^ Lifehacker - Google Chrome's Full List of Special about: Pages. [2016-06-28]. (原始内容存档于2013-06-27). 
  8. ^ Robitaille, Jason. Internalz 1.3 brings style with a dark theme and more. PreCentral. 2010-08-28 [2011-02-11]. (原始内容存档于2011-05-12).