<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Browser on Jaehyun&#39;s Blog</title>
    <link>https://hongjae.pages.dev/en/tags/browser/</link>
    <description>Recent content in Browser on Jaehyun&#39;s Blog</description>
    <image>
      <title>Jaehyun&#39;s Blog</title>
      <url>https://pub-8eb6fdee382f4b0390e652016dc5f15a.r2.dev/og-image.jpg</url>
      <link>https://pub-8eb6fdee382f4b0390e652016dc5f15a.r2.dev/og-image.jpg</link>
    </image>
    <generator>Hugo -- 0.118.2</generator>
    <language>en</language>
    <lastBuildDate>Thu, 02 Jul 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://hongjae.pages.dev/en/tags/browser/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Sending HTTP Requests Reliably When a Page Unloads</title>
      <link>https://hongjae.pages.dev/en/posts/260702-stable-http-request-on-page-exit/</link>
      <pubDate>Thu, 02 Jul 2026 00:00:00 +0000</pubDate>
      <guid>https://hongjae.pages.dev/en/posts/260702-stable-http-request-on-page-exit/</guid>
      <description>Navigator.sendBeacon() is designed to send data when a page is unloaded. It guarantees delivery even if the page is closed.
Basic usage:
navigator.sendBeacon(&amp;#39;/log&amp;#39;, JSON.stringify({ some: &amp;#39;data&amp;#39; })); The API does not allow custom headers. To send JSON with the proper Content-Type, use a Blob.
&amp;lt;a href=&amp;#34;/some-other-page&amp;#34; id=&amp;#34;link&amp;#34;&amp;gt;Go to Page&amp;lt;/a&amp;gt; &amp;lt;script&amp;gt; document.getElementById(&amp;#39;link&amp;#39;).addEventListener(&amp;#39;click&amp;#39;, (e) =&amp;gt; { const blob = new Blob([JSON.stringify({ some: &amp;#39;data&amp;#39; })], { type: &amp;#39;application/json; charset=UTF-8&amp;#39; }); navigator.sendBeacon(&amp;#39;/log&amp;#39;, blob); }); &amp;lt;/script&amp;gt; Compared to fetch with keepalive, sendBeacon uses low priority, so it does not interfere with critical page actions.</description>
    </item>
  </channel>
</rss>
