Hacker News new | past | comments | ask | show | jobs | submit login

> set an iframe's src to "view-source:https://example.com/",

is it possible to frame view-source?




It used to be possible in Chrome; I'm not sure about Firefox or modern builds of Chrome.


Here's a test, with this markup:

http://jsfiddle.net/GEynT

  <h1>IFrame, normal</h1>
  <iframe src="http://www.example.com/"></iframe>
  <h1>IFrame, view-source</h1>
  <iframe src="view-source:http://www.example.com/"></iframe>
Chrome does not allow it and instead shows a blank frame. Firefox will show the view-source window inside the iframe (which probably /shouldn't/ be allowed). IE10, interestingly, loads that page, and then redirects you to view-source:http://www.example.com immediately.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: