<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>XxGodmoonxX</author_name>
  <author_url>https://blog.hatena.ne.jp/XxGodmoonxX/</author_url>
  <blog_title>青いやつの進捗日記。</blog_title>
  <blog_url>https://tech.motoki-watanabe.net/</blog_url>
  <categories>
    <anon>matchMedia</anon>
    <anon>addListener</anon>
    <anon>addEventListener</anon>
    <anon>JavaScript</anon>
  </categories>
  <description>developer.mozilla.org matchmediaありますよね。上記を見てIE11も対応しているので油断していました。 window.matchMedia(`screen and (max-width: 768px)`).addEventListener('change', () =&gt; { }); 上記のようにmatchmediaの閾値を検出するのをaddEventListener('change'でやるとIE11やSafariで効きません。 developer.mozilla.org なので、以下のようにすると動きます。 window.matchMedia(`screen an…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftech.motoki-watanabe.net%2Fentry%2F2021%2F02%2F26%2F220238&quot; title=&quot;IE11やSafariでmatchMediaのaddEventListener(&amp;#39;change&amp;#39; は効かない - 青いやつの進捗日記。&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-02-26 22:02:38</published>
  <title>IE11やSafariでmatchMediaのaddEventListener('change' は効かない</title>
  <type>rich</type>
  <url>https://tech.motoki-watanabe.net/entry/2021/02/26/220238</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
