<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ayumu kitabayashi</title>
    <description>The latest articles on DEV Community by ayumu kitabayashi (@ayumu_kitabayashi_8e0de96).</description>
    <link>https://dev.to/ayumu_kitabayashi_8e0de96</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4188170%2Fa072cd70-859f-4132-b83e-2d26d3b6ad93.png</url>
      <title>DEV Community: ayumu kitabayashi</title>
      <link>https://dev.to/ayumu_kitabayashi_8e0de96</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ayumu_kitabayashi_8e0de96"/>
    <language>en</language>
    <item>
      <title>Hiding Instagram Reels inside a WKWebView: CSS fails silently, so count it</title>
      <dc:creator>ayumu kitabayashi</dc:creator>
      <pubDate>Fri, 16 Oct 2026 07:58:57 +0000</pubDate>
      <link>https://dev.to/ayumu_kitabayashi_8e0de96/hiding-instagram-reels-inside-a-wkwebview-css-fails-silently-so-count-it-2p3a</link>
      <guid>https://dev.to/ayumu_kitabayashi_8e0de96/hiding-instagram-reels-inside-a-wkwebview-css-fails-silently-so-count-it-2p3a</guid>
      <description>&lt;p&gt;I'm a solo developer in Japan, and I build minulo, an iPhone app for people who want to reply to Instagram DMs without getting pulled into Reels.&lt;/p&gt;

&lt;p&gt;The idea is simple. Instagram, YouTube and a few others open inside a WKWebView, and CSS removes the Reels/Shorts entry points. The official apps are blocked with Screen Time (FamilyControls / ManagedSettings), so opening them sends you to minulo instead.&lt;/p&gt;

&lt;p&gt;Here are three things that were harder than I expected.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Inject twice.&lt;/strong&gt; CSS goes in &lt;code&gt;injectedJavaScriptBeforeContentLoaded&lt;/code&gt;, otherwise the Reels tab flashes before it disappears. JS rules and a MutationObserver go in &lt;code&gt;injectedJavaScript&lt;/code&gt;. These sites are SPAs, so URL-scoped rules get re-applied on pushState/replaceState/popstate.&lt;/p&gt;

&lt;p&gt;I once wrapped &lt;code&gt;history.pushState&lt;/code&gt; inside the function that runs on every DOM change. Every run added another wrapper, so the longer the page stayed open, the slower it got, until it froze. Wrap once.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. &lt;code&gt;display:none&lt;/code&gt; can blank the whole feed.&lt;/strong&gt; Hiding suggested posts with &lt;code&gt;display:none&lt;/code&gt; stopped Instagram from rendering anything below them. The feed is virtualized, and a zero-height item seems to tell it there's nothing more to draw. I reproduced it 3/3 in the simulator. Now I tag the element and keep its height.&lt;/p&gt;

&lt;p&gt;Also, &lt;code&gt;a[href^="/reel"]&lt;/code&gt; looked like it hid the profile Reels tab. It only hid the icon. The link was still tappable, because that URL is &lt;code&gt;/&amp;lt;username&amp;gt;/reels/&lt;/code&gt;. &lt;code&gt;a[href$="/reels/"]&lt;/code&gt; fixed it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. CSS doesn't throw.&lt;/strong&gt; When a site changes its markup, the selector simply stops matching. Nothing errors, so try/catch won't catch it. Every 30 seconds, each rule's selector is run through &lt;code&gt;querySelectorAll&lt;/code&gt; and the match counts get posted back to the app. A rule that stays at zero is treated as broken. Two caveats: skip counting on login pages (everything is zero there), and only count URL-scoped rules on their own URLs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bonus:&lt;/strong&gt; opening a URL from a ShieldAction extension is silently ignored on a real device. My workaround: the shield button posts a local notification, and tapping it opens minulo. The blocked app's name is only known inside the extension, so I put it in the URL query, percent-encoded. With a space in the name, &lt;code&gt;URL(string:)&lt;/code&gt; returns nil and nothing happens.&lt;/p&gt;

&lt;p&gt;Hiding is free: &lt;a href="https://apps.apple.com/app/id6809352229" rel="noopener noreferrer"&gt;https://apps.apple.com/app/id6809352229&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ios</category>
      <category>reactnative</category>
      <category>webdev</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
