Skip to content

PerformanceTiming claims to return Int but they overflow #139

@behaghel

Description

@behaghel

I was trying to use it but I systematically get the following error when I access any of its values: XXXXX is not an instance of java.lang.Integer in the browser. Taking the js.Dynamic route works fine.

Fails:

    val window = dom.document.defaultView
    val perf = window.performance.timing
    PageLoad(perf.loadEventStart - perf.navigationStart)

Works:

    val window = DOMGlobalScope.window
    val perf = window.performance.timing
    PageLoad(perf.loadEventStart.asInstanceOf[Double] - perf.navigationStart.asInstanceOf[Double])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions