Skip to content

onload event not supported for PhantomJS, so CSSLoader hangs #4

@pmorch

Description

@pmorch

requirejs hangs forever on a css!file requirement in PhantomJS because of a known issue: onload event not fired for stylesheets · Issue #12332 · ariya/phantomjs.

The problem is in _isEventSupported that (more or less) comes from Detecting event support without browser sniffing — Perfection Kills. this._isEventSupported("link", "load") returns true for phantomjs even though it never actually fires :-(

I don't know that there is solution short of navigator.userAgent sniffing. I understand if you don't want that in your code, but reality is that for us, the initial require of many modules never returns and so none of our JavaScript is ever executed leaving an empty page in PhantomJS.

So should this._isEventSupported("link", "load") return false based on navigator.userAgent.match(/PhantomJS/)? Or should one white list the browsers where this._isEventSupported() is known to work instead? Not a pleasant choice to have to make...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions