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

MediaQueryList patch doesn't work in Safari #998

Closed
sod opened this issue Jan 25, 2018 · 1 comment · Fixed by #1003
Closed

MediaQueryList patch doesn't work in Safari #998

sod opened this issue Jan 25, 2018 · 1 comment · Fixed by #1003

Comments

@sod
Copy link

sod commented Jan 25, 2018

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
@JiaLiPassion
Copy link
Collaborator

@sod , thank you for posting the issue, I will check it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants