OpenWPM/test/test_pages/http_stacktrace.html

31 строка
1018 B
HTML

<!doctype html>
<html>
<head>
<title>async load by script</title>
<script type="application/javascript">
// inject a script using appendChild
// the script will load a pixel
function inject_js() {
var js=window.document.createElement("script");
js.setAttribute("async","true");
js.type="text/javascript"
js.src="https://gist.githack.com/gunesacar/b927d3fe69f3e7bf456da5192f74beea/raw/8d3e490b5988c633101ec45ef1443e61b1fd495e/inject_pixel.js";
window.document.body.appendChild(js);
}
// inject image using innerHTML
function inject_image() {
var img_div = document.getElementById("img-div-inline");
img_div.innerHTML = "<img src='shared/test_image.png' />";
}
function inject_all() {
inject_js();
inject_image();
}
</script>
</head>
<body onload="inject_all()">
<p> The scripts on this page inject an image, an invisible pixel and a script.</p>
<div id='pixel-div'></div>
<div id='img-div-inline'></div>
</body></html>