Stuffing HTML in an about: URL with Chrome

2019-07-17 04:47发布

问题:

In Internet Explorer back in the day you could type this into the URL bar:

about:<body bgcolor=red>

And the screen would turn red.

Is there an equivalent "heredoc" syntax for loading HTML via a URL in Chrome?

回答1:

A data URI, perhaps?

data:text/html,<body bgcolor=red>

Ironically, this does not work on IE, although MSDN claims this is due to security reasons.