blob: 2c2536c584177c572eb26c6ce9f49bb8cf6997c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
function send_ping() {
window.dispatchEvent(new Event("ping"));
}
send_ping(); // ping (=1)
window.addEventListener("load", function() {
send_ping(); // ping (=2)
// Append a script which should call |foo|, before the encoding of this script
// bytecode.
var script = document.createElement("script");
script.type = "text/javascript";
script.innerText = "send_ping();"; // ping (=3)
document.head.appendChild(script);
});
|