Skip to content
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
@EtherDream

Description

@EtherDream

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions