Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

MediaQueryList patch doesn't work in Safari #998

@sod

Description

@sod

The MediaQueryList patch doesn't work in Safari. MediaQueryList is not available on the global scope.

image

I saw that addListener wasn't patched because the console didn't show zone.js as source like the other patched methods

image

You receive an instance of MediaQueryList when doing matchMedia('')

image

Sadly for whatever reason the constructor is Object :(. So I'm not sure how to access the prototype. Using __proto__ is not really the way to go, isn't it?

I guess you'd have to patch addListener and removeListener on each matchMedia(...) call, if MediaQueryList isn't public.

Environment

  • Safari Technology Preview (desktop) Release 47
  • Safari (desktop) version 11.0.2
  • Platform: macOS 10.13.2

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