This repository was archived by the owner on May 30, 2023. It is now read-only.
This repository was archived by the owner on May 30, 2023. It is now read-only.
onInitialized
event triggers ONLY when the page content has script
elements #12387
Closed
Description
phantomjs
page.onAlert = function(msg) {
console.log(msg);
};
page.onInitialized = function() {
page.evaluate(function() {
document.addEventListener('error', function(e) {
alert(12345);
}, true);
});
};
html page
<div>
<img src="*" />
</div>
<script>
</script>
output: 12345
html page without script
<div>
<img src="*" />
</div>
output nothing