Last active
February 16, 2018 22:44
-
-
Save nolanlawson/f45d8ba9c9af356f7564ca5d27e6d50f to your computer and use it in GitHub Desktop.
Resource with unrecognized type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
display.innerText += 'Script downloaded and executed!\n' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head><title>Resource with unrecognized type</title></head> | |
<body> | |
<h1>Resource with unrecognized type</h1> | |
<p>Related: <a href='https://bugzilla.mozilla.org/show_bug.cgi?id=838521'>https://bugzilla.mozilla.org/show_bug.cgi?id=838521</a></p> | |
<pre id="display"></pre> | |
</body> | |
<script type="application/completely_fake_mime_type" src="file.js"></script> | |
<script> | |
intervalId = setInterval(function () { | |
var downloaded = performance.getEntriesByType('resource').some(function (resource) { | |
return resource.name.match(/file.js$/) | |
}) | |
if (downloaded) { | |
display.textContent += 'Resource was downloaded!\n' | |
clearInterval(intervalId) | |
} | |
}, 1000) | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment