<?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: Vladimir Elchinov</title>
    <description>The latest articles on DEV Community by Vladimir Elchinov (@vladimir_elchinov).</description>
    <link>https://dev.to/vladimir_elchinov</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%2F3418110%2Faca869d2-bf72-4840-ba6b-528b8be3a025.png</url>
      <title>DEV Community: Vladimir Elchinov</title>
      <link>https://dev.to/vladimir_elchinov</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vladimir_elchinov"/>
    <language>en</language>
    <item>
      <title>A Revoked Certificate Breaks Your Site in Firefox First. Chrome Can Take Days.</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Mon, 23 Nov 2026 13:57:41 +0000</pubDate>
      <link>https://dev.to/session_replay/a-revoked-certificate-breaks-your-site-in-firefox-first-chrome-can-take-days-5aj1</link>
      <guid>https://dev.to/session_replay/a-revoked-certificate-breaks-your-site-in-firefox-first-chrome-can-take-days-5aj1</guid>
      <description>&lt;p&gt;This morning a certificate authority, SECOM, filed a preliminary incident report in Mozilla's CA program: serial numbers from fifteen of its issuing CAs could be reproduced, because they came from Java's SHA1PRNG seeded with a value derived from the CA system's startup time. At least 116,740 affected certificates are still valid. What happens to them, SECOM says, will be in its full report. It has not said they will be revoked.&lt;/p&gt;

&lt;p&gt;Whatever SECOM decides, it is a good moment to know something most developers find out from a bug report: &lt;strong&gt;when a certificate is revoked, browsers do not find out at the same time.&lt;/strong&gt; For a while, the same site is broken in one browser and fine in another.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Firefox finds out
&lt;/h2&gt;

&lt;p&gt;Since Firefox 137, Firefox on desktop has used a mechanism called CRLite. Mozilla's description: Firefox "periodically downloads a compact encoding of the set of all revoked certificates that appear in Certificate Transparency logs", "updates it every 12 hours, and queries it privately every time a new TLS connection is created".&lt;/p&gt;

&lt;p&gt;So every revocation, for every certificate in the public logs, reaches desktop Firefox within about half a day.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Chrome finds out
&lt;/h2&gt;

&lt;p&gt;Chrome's security FAQ answers this directly. Its "primary mechanism for checking certificate revocation status is CRLSets", it honours stapled OCSP responses, and by default it does not perform "online" revocation checks at all. On coverage and timing it is careful: Chrome "enforces most security-relevant certificate revocations", and "most revocations should reach most users within a few days of appearing on a CA's CRL".&lt;/p&gt;

&lt;p&gt;Two qualifiers in there matter: &lt;em&gt;most&lt;/em&gt;, and &lt;em&gt;security-relevant&lt;/em&gt;. Whether a particular revocation reaches Chrome, and when, is Chrome's call.&lt;/p&gt;

&lt;h2&gt;
  
  
  What that looks like from the outside
&lt;/h2&gt;

&lt;p&gt;A certificate is revoked on Tuesday morning. By Tuesday evening, Firefox users on desktop can be getting a certificate error on your site. Chrome users, very often including the developer looking into it, may see nothing wrong for days.&lt;/p&gt;

&lt;p&gt;So the bug report reads "your site says it's not secure", the developer opens it in Chrome, it loads, and the report is closed as something on the user's machine. For days it really does look like one person's problem, because that is how the information is distributed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking it yourself in two minutes
&lt;/h2&gt;

&lt;p&gt;You do not need to wait for a browser to tell you. Pull the certificate the site is actually serving, then ask its CA's own revocation list:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;example.com
openssl s_client -connect &lt;span class="s2"&gt;"$host:443"&lt;/span&gt; -servername &lt;span class="s2"&gt;"$host"&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;/dev/null 2&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null \
  &lt;span class="o"&gt;|&lt;/span&gt; openssl x509 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; cert.pem

openssl x509 -in cert.pem -noout -issuer -serial
openssl x509 -in cert.pem -noout -ext crlDistributionPoints
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last line prints the URL of the issuer's CRL. Download it and look for your serial:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s -o ca.crl &lt;span class="s2"&gt;"http://the-url-from-above.crl"&lt;/span&gt;
openssl crl -inform DER -in ca.crl -noout -text &lt;span class="o"&gt;|&lt;/span&gt; grep -i &lt;span class="s2"&gt;"&amp;lt;serial from above&amp;gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No output means your certificate is not on that list. A match means it is revoked, whatever Chrome is currently showing you. (I ran this against a Let's Encrypt certificate while writing: the CRL held 2,359 revoked serials, in the same hex format &lt;code&gt;openssl x509 -serial&lt;/code&gt; prints, so a plain grep works.)&lt;/p&gt;

&lt;p&gt;The first command alone is worth running today if you are anywhere near the SECOM news: &lt;code&gt;-issuer&lt;/code&gt; tells you which CA signed your certificate, and the report lists the affected issuing CAs by name.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general version
&lt;/h2&gt;

&lt;p&gt;"It works in Chrome" is evidence about Chrome's state, not about your site's. Certificate revocation is one of the few failures where the browsers disagree by design, on a schedule, and between these two the disagreement runs in one direction: Firefox first. (I have not checked how Safari behaves, so do not read this as covering it.)&lt;/p&gt;

&lt;p&gt;When a certificate error arrives from one browser and not another, ask which browser and when, and check the revocation list before deciding it is their machine.&lt;/p&gt;

</description>
      <category>security</category>
      <category>firefox</category>
      <category>chrome</category>
      <category>ssl</category>
    </item>
    <item>
      <title>Your End-to-End Tests Run a Chrome With Popup Blocking and Background Throttling Turned Off</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Fri, 20 Nov 2026 13:57:39 +0000</pubDate>
      <link>https://dev.to/session_replay/your-end-to-end-tests-run-a-chrome-with-popup-blocking-and-background-throttling-turned-off-46l5</link>
      <guid>https://dev.to/session_replay/your-end-to-end-tests-run-a-chrome-with-popup-blocking-and-background-throttling-turned-off-46l5</guid>
      <description>&lt;p&gt;A user reports a bug. You write a Playwright or Puppeteer test that does exactly what they did. It passes. You close the report.&lt;/p&gt;

&lt;p&gt;Before you do, look at how your test runner starts Chrome, because it is not the way your user starts it. Both tools launch the browser with a list of default switches, and several of those switches turn off the precise behaviours that produce bugs users report and developers cannot reproduce.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the defaults are
&lt;/h2&gt;

&lt;p&gt;From Puppeteer's &lt;code&gt;ChromeLauncher.ts&lt;/code&gt; and Playwright's &lt;code&gt;chromiumSwitches.ts&lt;/code&gt;, current &lt;code&gt;main&lt;/code&gt; of each:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Both of them&lt;/strong&gt; pass &lt;code&gt;--disable-popup-blocking&lt;/code&gt;, &lt;code&gt;--disable-prompt-on-repost&lt;/code&gt;, &lt;code&gt;--disable-background-timer-throttling&lt;/code&gt;, &lt;code&gt;--disable-backgrounding-occluded-windows&lt;/code&gt; and &lt;code&gt;--disable-renderer-backgrounding&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Playwright also&lt;/strong&gt; passes &lt;code&gt;--disable-extensions&lt;/code&gt; and &lt;code&gt;--disable-back-forward-cache&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Puppeteer also&lt;/strong&gt; passes &lt;code&gt;--enable-automation&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Every one of those is a reasonable choice for a test runner. A suite needs to be deterministic, and a browser that blocks a popup sometimes, throttles a timer sometimes and restores a page from cache sometimes is not. The trouble is only that your users get the "sometimes".&lt;/p&gt;

&lt;h2&gt;
  
  
  The bug each one hides
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;--disable-popup-blocking&lt;/code&gt;.&lt;/strong&gt; Chrome lets a page open a window in response to a click. A &lt;code&gt;window.open&lt;/code&gt; that runs after an &lt;code&gt;await&lt;/code&gt;, once the click has been used up, is the classic one that works in development and is blocked in the field. With popup blocking off, it is never blocked in your tests either.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;--disable-prompt-on-repost&lt;/code&gt;.&lt;/strong&gt; The "Confirm Form Resubmission" dialog, which a user meets when they reload or go back to a page that was the result of a POST, does not appear. Whatever your page does after it is untested.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The three background switches.&lt;/strong&gt; Chromium's own description of &lt;code&gt;--disable-background-timer-throttling&lt;/code&gt; is "Disable task throttling of timer tasks from background pages", and of &lt;code&gt;--disable-renderer-backgrounding&lt;/code&gt; that renderers "are never told that they are backgrounded or hidden" at the operating system level. A user with your app in a background tab gets a &lt;code&gt;setInterval&lt;/code&gt; that fires far less often than you asked. Your test gets the interval you wrote.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;--disable-back-forward-cache&lt;/code&gt;&lt;/strong&gt; (Playwright). The back-forward cache restores a page exactly as the user left it when they press Back, without running your load code again. That is where "I pressed Back and the basket showed the old total" comes from. Playwright's source gives its reason in a comment: it "Avoids surprises like main request not being intercepted during page.goBack()". Sensible for a test, and it means no Playwright test of yours has ever met a page restored from that cache.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;--disable-extensions&lt;/code&gt;&lt;/strong&gt; (Playwright). No ad blocker, no privacy extension, no password manager. The requests those block, and the DOM they change, are not in your test's world, and they are in most of your users'.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;--enable-automation&lt;/code&gt;&lt;/strong&gt; (Puppeteer). This one switches off something specific. Chrome normally reloads a network error page by itself, after one second, then five, then thirty, and the code that installs that behaviour checks for this switch and leaves it out when it is present. A user sees an error flash and go away. Your test sees it stay.&lt;/p&gt;

&lt;p&gt;And under all of these, a fresh profile: no saved passwords, no cookies from last month, no history. That on its own is the difference between a login form a returning user sees already filled in and the empty one your test types into.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do about it
&lt;/h2&gt;

&lt;p&gt;Keep the defaults for the bulk of the suite. The determinism is worth it.&lt;/p&gt;

&lt;p&gt;Then add a small set of tests that run a Chrome closer to your users', for the specific behaviours your app depends on. Both tools take an &lt;code&gt;ignoreDefaultArgs&lt;/code&gt; option that removes named switches:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Playwright&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;chromium&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;ignoreDefaultArgs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'--disable-back-forward-cache'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'--disable-popup-blocking'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Puppeteer&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;puppeteer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;ignoreDefaultArgs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'--disable-popup-blocking'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'--disable-background-timer-throttling'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A test that opens a popup after an &lt;code&gt;await&lt;/code&gt;, one that presses Back on a page with state, one that leaves a timer running in a hidden tab: three tests, each aimed at a class of report you would otherwise close as "cannot reproduce".&lt;/p&gt;

&lt;h2&gt;
  
  
  The general version
&lt;/h2&gt;

&lt;p&gt;"It passes in my test" is a statement about the browser your tool built, not the one your user has. When a report will not reproduce, the first thing worth comparing is not their steps against yours. It is their browser's configuration against your test runner's launch arguments, and the runner's list is printed in its own source.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>playwright</category>
      <category>puppeteer</category>
      <category>chrome</category>
    </item>
    <item>
      <title>The Login Form Is Filled In and Your Code Sees Empty Strings. Chrome Is Doing It on Purpose.</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Thu, 19 Nov 2026 13:57:53 +0000</pubDate>
      <link>https://dev.to/session_replay/the-login-form-is-filled-in-and-your-code-sees-empty-strings-chrome-is-doing-it-on-purpose-2kmb</link>
      <guid>https://dev.to/session_replay/the-login-form-is-filled-in-and-your-code-sees-empty-strings-chrome-is-doing-it-on-purpose-2kmb</guid>
      <description>&lt;p&gt;The report goes something like this: "I open the login page, my email and password are already there, and the Sign in button is greyed out." You open the page. You type your test credentials. The button lights up. Closed, cannot reproduce.&lt;/p&gt;

&lt;p&gt;The reporter was right, and so was your test. They had a saved password. You did not.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Chrome does with a saved password on page load
&lt;/h2&gt;

&lt;p&gt;When Chrome's password manager fills a login form as the page loads, it does not put the values into the fields. Chromium's own source is explicit about it, in &lt;code&gt;password_autofill_agent.h&lt;/code&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;On page load, PWM preliminarily autofills usernames and passwords in a way that keeps them inaccessible to JavaScript using SetSuggestedValue() and WebAutofillState::kAutofilled.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And the class that enforces it, &lt;code&gt;PasswordValueGatekeeper&lt;/code&gt;, exists to ensure "that the autofilled values are not accessible to JavaScript code until the user interacts with the page". The comment gives the reasons as privacy and attack surface, and links the two Chromium bugs behind it.&lt;/p&gt;

&lt;p&gt;So for that window, the user sees both fields filled and your code reads this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;emailInput&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;     &lt;span class="c1"&gt;// ""&lt;/span&gt;
&lt;span class="n"&gt;passwordInput&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;  &lt;span class="c1"&gt;// ""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both of them, not just the password. The gatekeeper registers "every autofilled username and password field".&lt;/p&gt;

&lt;h2&gt;
  
  
  What a page built on the obvious pattern does with that
&lt;/h2&gt;

&lt;p&gt;Any code that reads the fields once and decides something gets the wrong answer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Sign in button that starts disabled and is enabled by checking the values on load.&lt;/li&gt;
&lt;li&gt;A "Continue" step that validates on load and shows "Password is required" under a field that visibly contains one.&lt;/li&gt;
&lt;li&gt;A framework store initialised from the DOM, which now holds two empty strings and will not look again.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this happens in a clean test profile, because there is nothing saved to fill. It does not happen in Playwright or Cypress either, because the browsers they drive start with no saved passwords. It happens to returning users with saved passwords, which is to say the people most likely to be logging in at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  When the values arrive, and what fires
&lt;/h2&gt;

&lt;p&gt;The first time the user interacts with the page, the gatekeeper calls &lt;code&gt;ShowValue&lt;/code&gt; on each field it held back, and that calls &lt;code&gt;SetAutofillValue&lt;/code&gt;. In Blink's &lt;code&gt;web_form_control_element.cc&lt;/code&gt; that function does more than set a value. For a field without focus it dispatches a &lt;code&gt;focus&lt;/code&gt; event, then a synthetic &lt;code&gt;keydown&lt;/code&gt; ("in case the website checks via JS that a keyboard interaction took place", says the comment), then sets the value, which sends &lt;code&gt;input&lt;/code&gt; and &lt;code&gt;change&lt;/code&gt;, then &lt;code&gt;keyup&lt;/code&gt;, then &lt;code&gt;blur&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That sequence is the whole fix, if your code is listening for it. A button whose state is recomputed on every &lt;code&gt;input&lt;/code&gt; event recovers the moment the user clicks anywhere. One whose state was computed once on load does not, and since a disabled button does not dispatch &lt;code&gt;click&lt;/code&gt; to your handler, the user can press it all day.&lt;/p&gt;

&lt;p&gt;The synthetic &lt;code&gt;focus&lt;/code&gt; and &lt;code&gt;blur&lt;/code&gt; are worth knowing about as well. Validation that marks a field as touched on blur will consider both fields touched before the user has looked at them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Telling "empty" from "filled, not yet released"
&lt;/h2&gt;

&lt;p&gt;The field is in an autofilled state before its value is exposed, and CSS can see that state. In Blink, &lt;code&gt;:autofill&lt;/code&gt; (and the older &lt;code&gt;:-webkit-autofill&lt;/code&gt;) match when the field &lt;code&gt;IsAutofilled()&lt;/code&gt;, which is exactly the state the preliminary fill sets. So:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;looksEmptyButIsnt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;matches&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;':autofill'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;matches&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;':-webkit-autofill'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use it to avoid showing an error, not to read the password. The value stays out of reach until the user acts, by design, and nothing on the page should try to get round that.&lt;/p&gt;

&lt;p&gt;The simpler fix is not to gate the button at all. Leave Sign in enabled and validate on submit. By the time anybody submits, they have clicked or pressed a key, the gatekeeper has released the values, and your validation sees what the user sees.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general version
&lt;/h2&gt;

&lt;p&gt;This is the shape of a lot of "cannot reproduce" closures: the state that triggers the bug is something the user has and the developer's test setup is built not to have. Saved passwords, an installed extension, a cookie from last month. If a report says the form was already filled in, believe that sentence before anything else in it.&lt;/p&gt;

&lt;p&gt;Behaviour described here is Chrome's, from Chromium's source. I have not checked what other browsers do in the same window, so test those separately rather than assuming.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>chrome</category>
      <category>forms</category>
      <category>security</category>
    </item>
    <item>
      <title>Your Error Log Says `{}`. The Usual Fix Still Loses the Stack in Firefox.</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Wed, 18 Nov 2026 13:58:39 +0000</pubDate>
      <link>https://dev.to/session_replay/your-error-log-says-the-usual-fix-still-loses-the-stack-in-firefox-3197</link>
      <guid>https://dev.to/session_replay/your-error-log-says-the-usual-fix-still-loses-the-stack-in-firefox-3197</guid>
      <description>&lt;p&gt;Somewhere in most front-end codebases there is a line like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'checkout failed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And somewhere in the log store there are a few hundred entries that read &lt;code&gt;checkout failed {"err":{}}&lt;/code&gt;. Nobody notices until the day a customer says the payment page broke, and the one record of what happened says nothing at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why an Error serialises to nothing
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;JSON.stringify&lt;/code&gt; only writes an object's own enumerable properties. The ECMAScript specification's Error constructor creates the message with &lt;code&gt;CreateNonEnumerableDataPropertyOrThrow(obj, "message", messageString)&lt;/code&gt;, and &lt;code&gt;cause&lt;/code&gt; is installed the same way. Non-enumerable, by design, so the message is invisible to &lt;code&gt;JSON.stringify&lt;/code&gt;, to &lt;code&gt;Object.keys&lt;/code&gt; and to spread. &lt;code&gt;stack&lt;/code&gt; is not in the specification at all, and every engine puts it somewhere different. That last part is where the usual fix comes apart.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix everybody copies
&lt;/h2&gt;

&lt;p&gt;The answer you find first is to pass the property names explicitly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getOwnPropertyNames&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I ran it in Chrome 157, Firefox 146 and the JavaScriptCore engine that ships with macOS, on &lt;code&gt;new Error('Payment failed', { cause: { code: 402 } })&lt;/code&gt;. Three different results:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Chrome:&lt;/strong&gt; &lt;code&gt;stack&lt;/code&gt;, &lt;code&gt;message&lt;/code&gt;, &lt;code&gt;cause&lt;/code&gt;. The stack survives.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JavaScriptCore:&lt;/strong&gt; &lt;code&gt;message&lt;/code&gt;, &lt;code&gt;cause&lt;/code&gt;, &lt;code&gt;line&lt;/code&gt;, &lt;code&gt;column&lt;/code&gt;, &lt;code&gt;sourceURL&lt;/code&gt;, &lt;code&gt;stack&lt;/code&gt;. The stack survives.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Firefox:&lt;/strong&gt; &lt;code&gt;fileName&lt;/code&gt;, &lt;code&gt;lineNumber&lt;/code&gt;, &lt;code&gt;columnNumber&lt;/code&gt;, &lt;code&gt;message&lt;/code&gt;, &lt;code&gt;cause&lt;/code&gt;. &lt;strong&gt;No stack.&lt;/strong&gt; In Firefox, &lt;code&gt;stack&lt;/code&gt; is an accessor on &lt;code&gt;Error.prototype&lt;/code&gt;, not a property of the error, so &lt;code&gt;getOwnPropertyNames&lt;/code&gt; never lists it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the same line gives you a stack trace for Chrome users and a file name and line number for Firefox users, and whichever browser you test in decides which one you think you have.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two more holes in it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The cause comes back empty in every engine.&lt;/strong&gt; In all three, the &lt;code&gt;cause&lt;/code&gt; above serialised as &lt;code&gt;{}&lt;/code&gt;. A replacer array is not a list of keys for the top-level object. The specification's &lt;code&gt;SerializeJSONObject&lt;/code&gt; uses it as the key list at &lt;em&gt;every&lt;/em&gt; level, so the nested object is filtered to keys named &lt;code&gt;stack&lt;/code&gt;, &lt;code&gt;message&lt;/code&gt; and so on, and &lt;code&gt;{ code: 402 }&lt;/code&gt; has none of them. The one field that said why the payment failed is the one that disappears.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A DOMException gives you nothing at all.&lt;/strong&gt; &lt;code&gt;AbortError&lt;/code&gt;, &lt;code&gt;NotAllowedError&lt;/code&gt;, &lt;code&gt;QuotaExceededError&lt;/code&gt; and the rest are DOMExceptions, and their &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;message&lt;/code&gt; are Web IDL attributes, which live as accessors on the prototype. On &lt;code&gt;new DOMException('The user aborted a request.', 'AbortError')&lt;/code&gt;, &lt;code&gt;getOwnPropertyNames&lt;/code&gt; returned an empty array in both Chrome and Firefox, and the "fixed" stringify returned &lt;code&gt;{}&lt;/code&gt;. In Firefox, the abort reason from a real &lt;code&gt;AbortController&lt;/code&gt; did the same. Chrome's own abort reason carries an own &lt;code&gt;stack&lt;/code&gt;, so there you get the stack text and nothing else.&lt;/p&gt;

&lt;p&gt;That is the class of failure most worth reading in a front-end log: storage quota, a permission refused, a request cancelled. They are the ones serialised to &lt;code&gt;{}&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to log instead
&lt;/h2&gt;

&lt;p&gt;Read the properties by name. A getter works fine when you ask for it directly; it is only enumeration that skips it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;describeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;depth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="s1"&gt;'object'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;thrown&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;            &lt;span class="c1"&gt;// someone threw a string&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="s1"&gt;'string'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;                                &lt;span class="c1"&gt;// a plain object as cause: keep it as is&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stack&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cause&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;depth&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cause&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;describeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cause&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;depth&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'checkout failed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;describeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the same three inputs this gives the stack in Firefox, the &lt;code&gt;{ code: 402 }&lt;/code&gt; cause intact, and &lt;code&gt;AbortError&lt;/code&gt; with its message for the DOMException. The &lt;code&gt;depth&lt;/code&gt; limit is there because a cause chain can point back at itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general version
&lt;/h2&gt;

&lt;p&gt;A log line is a bug report written by your code instead of a person, and it fails the same way a person's does: it records what was easy to record, not what you will need. The time to find out that it says &lt;code&gt;{}&lt;/code&gt; is before the incident, so pick one &lt;code&gt;catch&lt;/code&gt; block today, throw a DOMException through it in Firefox, and read what lands in the log.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>firefox</category>
      <category>logging</category>
      <category>errors</category>
    </item>
    <item>
      <title>Your Bug Report Says "iPhone". The Screen Is 448 by 364.</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Tue, 17 Nov 2026 13:58:17 +0000</pubDate>
      <link>https://dev.to/session_replay/your-bug-report-says-iphone-the-screen-is-448-by-364-4hni</link>
      <guid>https://dev.to/session_replay/your-bug-report-says-iphone-the-screen-is-448-by-364-4hni</guid>
      <description>&lt;p&gt;Last Friday Safari arrived on a new device: Apple HomeView, which has a square 7-inch display that people mostly use with their voice. WebKit's announcement includes a line that will produce a particular kind of bug report for the next year:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Safari on HomeView also reports an iOS user agent.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So the report will say "iOS Safari". You will pick up an iPhone, open the page, and it will be fine. Not because the bug is not real, but because the report described the wrong thing. It classified the device, and the device class is the one fact that does not decide how a page renders.&lt;/p&gt;

&lt;h2&gt;
  
  
  A user agent is a claim. A viewport is a measurement.
&lt;/h2&gt;

&lt;p&gt;Everything about how your layout behaves is decided by a handful of numbers the browser can measure directly: the width and height of the viewport, whether the primary pointer is precise, whether it can hover. The user agent is a string that a vendor chose, and on HomeView it says iOS.&lt;/p&gt;

&lt;p&gt;WebKit is specific about what that hides. The screen is square, and "Some sites assume the viewport is always taller than 600px, while on HomeView it’s shorter." Its suggested test size is 448 by 364. Put a sticky header and a sticky footer on that and there is very little page left between them. Put a newsletter modal on it that is taller than the viewport, and its close button can sit below the bottom of the screen with no way to scroll to it.&lt;/p&gt;

&lt;p&gt;None of that is in the words "iOS Safari".&lt;/p&gt;

&lt;h2&gt;
  
  
  Record the screen, not the category
&lt;/h2&gt;

&lt;p&gt;The fix for the report is small. Capture what the page actually had to work with, at the moment it went wrong:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;describeScreen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;vv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;visualViewport&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;viewport&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`${window.innerWidth}x${window.innerHeight}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;visualViewport&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;vv&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="sb"&gt;`${Math.round(vv.width)}x${Math.round(vv.height)} @ ${vv.scale}`&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;devicePixelRatio&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;devicePixelRatio&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;pointer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;matchMedia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'(pointer: fine)'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;matches&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s1"&gt;'fine'&lt;/span&gt;
           &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;matchMedia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'(pointer: coarse)'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;matches&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s1"&gt;'coarse'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'none'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;hover&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;matchMedia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'(hover: hover)'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;matches&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;orientation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orientation&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orientation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;userAgent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;userAgent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;// still worth keeping, just not trusting&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The media features are not guesses. The Media Queries specification defines &lt;code&gt;pointer&lt;/code&gt; as reflecting "the characteristics of the “primary” pointing device, as determined by the user agent", and &lt;code&gt;coarse&lt;/code&gt; as "a pointing device of limited accuracy. Examples include touchscreens". &lt;code&gt;hover&lt;/code&gt; is defined the same way, for the ability to hover over elements with that primary pointer. They answer the question your CSS is actually asking, which is why they are the thing to log.&lt;/p&gt;

&lt;p&gt;Do not assume what any of them will say on HomeView. WebKit's post does not tell you, and the point of measuring is that you no longer need to be told.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproduce with the numbers, not the device
&lt;/h2&gt;

&lt;p&gt;Once a report carries &lt;code&gt;448x364&lt;/code&gt;, you do not need the device. Responsive design mode in any browser will give you that viewport, and WebKit's own advice for anybody without the hardware is the same idea: "test your site on a phone in landscape orientation", which is short in the same way.&lt;/p&gt;

&lt;p&gt;Without the numbers, you are guessing at a device from a string that, on this device, names the wrong one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general version
&lt;/h2&gt;

&lt;p&gt;HomeView is just the cleanest recent example of an old problem. Device names are categories, and categories are how people describe what they were holding. Layout bugs live in the dimensions, the input method and the zoom level, and none of those survive the trip into "it's broken on my iPhone" unless something captured them before the person started typing.&lt;/p&gt;

&lt;p&gt;Ask for the numbers, or collect them. Treat "iPhone" in a report as the beginning of a question, not the answer to one.&lt;/p&gt;

</description>
      <category>css</category>
      <category>javascript</category>
      <category>ios</category>
      <category>ux</category>
    </item>
    <item>
      <title>Your Old Certificate Works in Firefox and the Renewed One Does Not. Here Is the Line That Decides.</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Mon, 16 Nov 2026 13:58:08 +0000</pubDate>
      <link>https://dev.to/session_replay/your-old-certificate-works-in-firefox-and-the-renewed-one-does-not-here-is-the-line-that-decides-maf</link>
      <guid>https://dev.to/session_replay/your-old-certificate-works-in-firefox-and-the-renewed-one-does-not-here-is-the-line-that-decides-maf</guid>
      <description>&lt;p&gt;Picture the report. A Firefox user says your site shows a certificate warning. You open it in your browser and it is fine. You check the server and nothing has changed in months, except that the certificate renewed itself last week, which it does every few months without anybody looking.&lt;/p&gt;

&lt;p&gt;Last week Mozilla shipped, and then reversed, a change that makes this report possible for real sites. The interesting part is not the incident. It is the mechanism, because it means a certificate can be refused for its birthday.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened
&lt;/h2&gt;

&lt;p&gt;DigiCert's transition plan asked for its Trusted Root G4 to stop being trusted for websites. Mozilla made the change in NSS, the certificate library Firefox uses, with the note "Changes made in NSS 3.134 and FF 162". It then received "preliminary indications of TLS connection failures" on the site of a German bank, DKB, and on 13 November it changed course.&lt;/p&gt;

&lt;p&gt;The commit that went in instead is short. Here is the relevant part of the diff to &lt;code&gt;certdata.txt&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;-CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE&lt;/span&gt;
&lt;span class="gi"&gt;+# For Server Distrust After: Mon Sep 14 23:59:59 2026&lt;/span&gt;
&lt;span class="gi"&gt;+CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL&lt;/span&gt;
&lt;span class="gi"&gt;+\062\066\060\071\061\064\062\063\065\071\065\071\132&lt;/span&gt;
&lt;span class="gi"&gt;+END&lt;/span&gt;
&lt;span class="gd"&gt;-CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_MUST_VERIFY_TRUST&lt;/span&gt;
&lt;span class="gi"&gt;+CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The root is trusted for websites again, with a date attached. Mozilla's reviewer counted 148 unexpired certificates still chaining to that root, which is why a hard cut broke things and a date did not. Firefox 162 is two releases ahead of the 160 that shipped last week, so release users never saw the broken version.&lt;/p&gt;

&lt;h2&gt;
  
  
  The line that decides
&lt;/h2&gt;

&lt;p&gt;A distrust-after date does not mean "stop trusting this root after this day". It means something narrower, and the narrowness is the hazard. In Firefox's &lt;code&gt;NSSCertDBTrustDomain.cpp&lt;/code&gt; the check ends like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="nc"&gt;Time&lt;/span&gt; &lt;span class="n"&gt;distrustAfterTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="n"&gt;mozilla&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;pkix&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;TimeFromEpochInSeconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;distrustAfter&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="no"&gt;PR_USEC_PER_SEC&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;distrustAfterTimeOut&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;emplace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;distrustAfterTime&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;endEntityNotBefore&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;distrustAfterTime&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;isDistrusted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;endEntityNotBefore&lt;/code&gt; is the issue date of your certificate, the leaf, not the root's or the intermediate's, and not today's date. A certificate issued before the cutoff stays trusted until it expires. A certificate issued after it, from the same CA, through the same intermediate, for the same domain, is refused.&lt;/p&gt;

&lt;p&gt;So on the day your renewal runs, nothing about your server changes except one date in one field, and Firefox's answer flips.&lt;/p&gt;

&lt;p&gt;It is not easy to talk your way round either. In &lt;code&gt;MultiLogCTVerifier.cpp&lt;/code&gt;, the Certificate Transparency timestamps a certificate carries are checked against the same date:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// If the root has a distrustAfter time, ensure that the SCT's timestamp is&lt;/span&gt;
&lt;span class="c1"&gt;// not after that time.&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;distrustAfterTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isSome&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;sctTime&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;distrustAfterTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;value&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sctsWithDistrustedTimestamps&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Success&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The logs' own clock is consulted, not just the date the CA wrote on the certificate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this is invisible from your desk
&lt;/h2&gt;

&lt;p&gt;Every check you are likely to run first says the site is fine.&lt;/p&gt;

&lt;p&gt;Your own browser may not be Firefox, and each browser keeps its own list of trusted roots with its own rules attached. A monitoring probe or a script runs on whatever trust store its own runtime ships with. Your previous certificate, the one you tested when you set this up, was issued before the cutoff. None of those can see a rule that depends on the issue date of a certificate you have not looked at since it renewed.&lt;/p&gt;

&lt;p&gt;And the report itself will not help. "Firefox says the connection is not secure" is the same sentence for an expired certificate, a wrong clock on their laptop, a corporate proxy, and this. The difference is in which root the chain ends at and when the leaf was issued, and the person reporting it has no reason to know either.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking your own chain
&lt;/h2&gt;

&lt;p&gt;Two questions, and both have one-line answers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Which root does the chain end at? Read the last issuer.&lt;/span&gt;
openssl s_client -connect example.com:443 -servername example.com -showcerts &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;/dev/null 2&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null \
  &lt;span class="o"&gt;|&lt;/span&gt; grep -E &lt;span class="s1"&gt;'^ *[0-9] s:|i:'&lt;/span&gt;

&lt;span class="c"&gt;# When was the certificate you are serving issued?&lt;/span&gt;
openssl s_client -connect example.com:443 -servername example.com &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;/dev/null 2&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null \
  &lt;span class="o"&gt;|&lt;/span&gt; openssl x509 -noout -startdate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the chain ends at a root with a distrust-after date and &lt;code&gt;notBefore&lt;/code&gt; is later than it, Firefox will refuse it once that rule is in the release a user is running, and nothing on your side will have changed. The fix is not on the server. It is a certificate issued under a different root.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to take from it
&lt;/h2&gt;

&lt;p&gt;A certificate warning in one browser only is a question about that browser's root store before it is a question about your server. Ask which browser and version, look at which root your chain ends at, and look at when the certificate was issued. Renewal automation is the thing most likely to move that last date without anybody noticing, and a distrust-after rule is the thing that makes the date matter.&lt;/p&gt;

</description>
      <category>security</category>
      <category>firefox</category>
      <category>tls</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A CORS Error on a POST Does Not Mean the POST Failed</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Fri, 13 Nov 2026 13:58:17 +0000</pubDate>
      <link>https://dev.to/session_replay/a-cors-error-on-a-post-does-not-mean-the-post-failed-8ed</link>
      <guid>https://dev.to/session_replay/a-cors-error-on-a-post-does-not-mean-the-post-failed-8ed</guid>
      <description>&lt;p&gt;Somebody clicks Pay. The console says the request was blocked by CORS policy, the button says something went wrong, and they click it again.&lt;/p&gt;

&lt;p&gt;Did you just charge them twice, or not at all? The answer depends on a header you probably did not choose on purpose, and nothing your JavaScript received can tell you which.&lt;/p&gt;

&lt;h2&gt;
  
  
  "The browser blocked the request" is half right
&lt;/h2&gt;

&lt;p&gt;That is how CORS errors usually get explained, and for one kind of request it is true. For the other kind, the request went out, the server ran it, and the only thing the browser blocked was your script reading the answer.&lt;/p&gt;

&lt;p&gt;The Fetch Standard is explicit about the order. In the step that actually goes to the network:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Set response and internalResponse to the result of running HTTP-network-or-cache fetch given fetchParams. If request’s response tainting is "cors" and a CORS check for request and response returns failure, then return a network error.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The fetch happens first. The check is applied to a response that has already come back, from a server that has already done whatever the request asked. A failed check discards the response. It cannot undo the work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which kind of request you sent
&lt;/h2&gt;

&lt;p&gt;Some cross-origin requests get a preflight first: an &lt;code&gt;OPTIONS&lt;/code&gt; request asking permission before the real one is sent. When the preflight fails, the spec returns the network error at that point, and the real request never leaves the browser. Nothing was written.&lt;/p&gt;

&lt;p&gt;Others skip the preflight entirely. The spec's rule is that a preflight is needed when the method is not a CORS-safelisted method, or when there is a header that is not safelisted. The safelisted methods are &lt;code&gt;GET&lt;/code&gt;, &lt;code&gt;HEAD&lt;/code&gt; and &lt;code&gt;POST&lt;/code&gt;. For &lt;code&gt;Content-Type&lt;/code&gt;, only three values pass: &lt;code&gt;application/x-www-form-urlencoded&lt;/code&gt;, &lt;code&gt;multipart/form-data&lt;/code&gt; and &lt;code&gt;text/plain&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now look at what &lt;code&gt;fetch&lt;/code&gt; puts on a body you did not label. A string body gets &lt;code&gt;text/plain;charset=UTF-8&lt;/code&gt;, &lt;code&gt;URLSearchParams&lt;/code&gt; gets the form type, and &lt;code&gt;FormData&lt;/code&gt; gets multipart. All three are on the safelist.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// No preflight. This POST is sent, and the server handles it,&lt;/span&gt;
&lt;span class="c1"&gt;// whatever happens to the CORS check afterwards.&lt;/span&gt;
&lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://api.example.com/orders'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'POST'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;// Content-Type: text/plain;charset=UTF-8&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Preflighted. OPTIONS goes first. If it fails, this POST is never sent.&lt;/span&gt;
&lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://api.example.com/orders'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'POST'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s1"&gt;'Content-Type'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'application/json'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first one is the easiest call to write and the one people write when they forget the header. Whether it writes anything depends on whether the server reads a body labelled &lt;code&gt;text/plain&lt;/code&gt;. Some frameworks ignore it; anything that parses the raw body will act on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Your code cannot tell the two apart
&lt;/h2&gt;

&lt;p&gt;Both calls fail the same way. When the result is a network error, the spec says to reject the promise with a &lt;code&gt;TypeError&lt;/code&gt;. That is the same &lt;code&gt;TypeError&lt;/code&gt; a dropped connection produces, so &lt;code&gt;catch&lt;/code&gt; sees an identical error whether the order was written, half written, or never sent. The status code and the response body never reach your script.&lt;/p&gt;

&lt;p&gt;Which makes the obvious retry dangerous:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;placeOrder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'POST'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'POST'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// second order&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On a simple request with broken CORS, that is two orders and a user who saw two errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  And neither can the bug report
&lt;/h2&gt;

&lt;p&gt;The person reporting it says the same sentence either way: "it gave me an error, so I tried again." Their screen looked identical in both cases. Their description cannot distinguish a write that happened from one that did not, because they never saw anything that could.&lt;/p&gt;

&lt;p&gt;What can distinguish them is the network traffic. A preflight failure leaves an &lt;code&gt;OPTIONS&lt;/code&gt; request to that URL with no &lt;code&gt;POST&lt;/code&gt; after it. A simple request leaves a &lt;code&gt;POST&lt;/code&gt; that reached the server, which you can confirm in the server's own access log at that minute. One caveat: a successful earlier preflight can be cached, so a missing &lt;code&gt;OPTIONS&lt;/code&gt; in a capture is not proof on its own. The server log is the witness that cannot be wrong about whether the write arrived.&lt;/p&gt;

&lt;p&gt;So before anyone refunds, retries or replies "nothing went through", check the log.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do about it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Label JSON as JSON.&lt;/strong&gt; Setting &lt;code&gt;Content-Type: application/json&lt;/code&gt; forces the preflight, so a CORS misconfiguration fails before the server acts instead of after.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Do not retry a write on &lt;code&gt;TypeError&lt;/code&gt;.&lt;/strong&gt; It does not mean nothing happened. It means you do not know.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make writes idempotent.&lt;/strong&gt; An idempotency key on the request lets the server recognise the second attempt as the first one again.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Triage a CORS report on a write as "unknown outcome", not "failed".&lt;/strong&gt; The browser said it would not show you the answer. It did not say there was no answer.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>api</category>
      <category>http</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Your input Handler Is Firing on Half a Character, and You Cannot Reproduce It</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Wed, 11 Nov 2026 14:00:20 +0000</pubDate>
      <link>https://dev.to/session_replay/your-input-handler-is-firing-on-half-a-character-and-you-cannot-reproduce-it-4igk</link>
      <guid>https://dev.to/session_replay/your-input-handler-is-firing-on-half-a-character-and-you-cannot-reproduce-it-4igk</guid>
      <description>&lt;p&gt;A report comes in saying the search box "goes mad" while they type, or that the form will not accept their name, or that the character counter is wrong. You open the page, type the same thing, and everything is fine.&lt;/p&gt;

&lt;p&gt;They are using an input method editor. You are not.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a composition session is
&lt;/h2&gt;

&lt;p&gt;An IME is how you type a language with more characters than keys. You type several keystrokes, the system shows a provisional string, and at some point you commit it and the real text lands. Japanese, Chinese and Korean most obviously, but the same machinery covers something far more common than that, which I will come back to.&lt;/p&gt;

&lt;p&gt;The W3C UI Events specification calls this a composition session, and describes it as "one compositionstart event, one or more compositionupdate events" and "one compositionend event".&lt;/p&gt;

&lt;p&gt;So far so reasonable. The part that breaks code is what happens &lt;em&gt;inside&lt;/em&gt; the session.&lt;/p&gt;

&lt;h2&gt;
  
  
  Your input listener fires on the provisional text
&lt;/h2&gt;

&lt;p&gt;Section 3.6.6 of the spec is titled "Input Events During Composition", and it sets the order: for each update, &lt;code&gt;beforeinput&lt;/code&gt;, then &lt;code&gt;compositionupdate&lt;/code&gt;, then &lt;code&gt;input&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So &lt;code&gt;input&lt;/code&gt; fires repeatedly, during the session, carrying text the user has not committed and in many cases would not recognise as anything they typed.&lt;/p&gt;

&lt;p&gt;And then the sting, from the same section:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Since there are no DOM updates associated with the compositionend event, beforeinput and input events should not be sent at that time.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Read that twice if you have ever written &lt;code&gt;field.addEventListener('input', validate)&lt;/code&gt;. Your handler runs several times on provisional fragments, and then &lt;strong&gt;does not run at the moment the user finishes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The practical results are all the ones in that bug report. A validator rejecting a half-formed string. A character counter counting the wrong thing. A search-as-you-type sending a request per keystroke of a word that does not exist yet. An autosave storing a fragment.&lt;/p&gt;

&lt;h2&gt;
  
  
  The flag that fixes it
&lt;/h2&gt;

&lt;p&gt;Both &lt;code&gt;InputEvent&lt;/code&gt; and &lt;code&gt;KeyboardEvent&lt;/code&gt; carry &lt;code&gt;isComposing&lt;/code&gt;, defined as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;true if the input event occurs as part of a composition session,&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and, completing the sentence, "i.e., after a compositionstart event and before the corresponding compositionend event." Its uninitialized value "MUST be false", so on ordinary typing it is simply false and costs you nothing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;committed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;committed&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;   &lt;span class="c1"&gt;// the same commit, delivered twice&lt;/span&gt;
  &lt;span class="n"&gt;committed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;
  &lt;span class="nf"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;committed&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'input'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isComposing&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;          &lt;span class="c1"&gt;// provisional text, not a value yet&lt;/span&gt;
  &lt;span class="nf"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// and because no input event is supposed to arrive at the end of a session:&lt;/span&gt;
&lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'compositionend'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two listeners. The second one is the half people leave out, and leaving it out means an IME user's committed text is never processed at all.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;committed&lt;/code&gt; check is there because "supposed to" is doing work in that comment. The specification says that since &lt;code&gt;compositionend&lt;/code&gt; makes no change to the DOM, input events "should not be sent at that time". A reader reports that Safari sends one anyway, an &lt;code&gt;input&lt;/code&gt; carrying the committed value right after &lt;code&gt;compositionend&lt;/code&gt;, which without the check runs &lt;code&gt;handle&lt;/code&gt; twice for one commit. Guarding on the value costs nothing in a browser that follows the spec, and stops a side effect from happening twice in one that does not.&lt;/p&gt;

&lt;h2&gt;
  
  
  The advice you will find, and why it is wrong
&lt;/h2&gt;

&lt;p&gt;Search this problem and you will be told to check for &lt;code&gt;keyCode === 229&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That does appear in the specification. It appears in section 7.3.1, under a heading that says, in the document's own words, "This section is non-normative", in a legacy appendix describing one historical model. The same document says plainly:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Authors SHOULD use the key attribute instead of the charCode and keyCode attributes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It also notes that keyCode's values "are not normatively defined in this specification". So the famous number is not a rule, it is a description of what some implementations used to do. &lt;code&gt;isComposing&lt;/code&gt; is the attribute that is actually specified for this, and it is on the event you are already handling.&lt;/p&gt;

&lt;p&gt;One more correction while here: it is often said that key events stop during composition. The spec says the opposite. "During the composition session, keydown and keyup events MUST still be sent," and those events "MUST have the isComposing attribute set to true".&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this is not only a CJK problem
&lt;/h2&gt;

&lt;p&gt;Here is the line that should widen your idea of who is affected. The spec describes &lt;code&gt;isComposing&lt;/code&gt; on the input event as true when the event is dispatched&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;during a dead key sequence or while an input method editor is active&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Dead keys.&lt;/strong&gt; A French, Czech, or Vietnamese layout, or a US-International layout, produces accented characters by a dead key followed by a letter. That is a composition session too. Anybody typing &lt;code&gt;é&lt;/code&gt;, &lt;code&gt;ñ&lt;/code&gt;, &lt;code&gt;ô&lt;/code&gt; or &lt;code&gt;ü&lt;/code&gt; can hit the same code path, on the same keyboard hardware you have.&lt;/p&gt;

&lt;p&gt;Which is the honest reason this survives so long in so many codebases. It is not exotic. It is simply invisible from a machine configured the way yours is, and the people who hit it describe it in the only words available to them: it does not work when I type my name.&lt;/p&gt;

&lt;p&gt;That sentence contains the entire bug and explains none of it, and no amount of re-reading the ticket will get you to a dead key.&lt;/p&gt;




&lt;p&gt;Specification quotes are from the W3C UI Events Working Draft of 21 February 2026, which asks to be cited as a work in progress.&lt;/p&gt;

</description>
      <category>i18n</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>ux</category>
    </item>
    <item>
      <title>Chrome Patched a Zero-Day Yesterday, and Your Logs Cannot Tell You Who Still Needs It</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Tue, 10 Nov 2026 13:59:39 +0000</pubDate>
      <link>https://dev.to/session_replay/chrome-patched-a-zero-day-yesterday-and-your-logs-cannot-tell-you-who-still-needs-it-5enb</link>
      <guid>https://dev.to/session_replay/chrome-patched-a-zero-day-yesterday-and-your-logs-cannot-tell-you-who-still-needs-it-5enb</guid>
      <description>&lt;p&gt;Chrome's Stable channel went to 157.0.8103.50/.51 on Monday with nine security fixes. One line in that post is the one that changes your week:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Google is aware that an exploit for CVE-2026-125350 exists in the wild.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So the patch level matters, specifically and immediately. A user on 157.0.8103.49 has a known exploited use-after-free. A user on .51 does not. Same major version, different answer.&lt;/p&gt;

&lt;p&gt;Now the uncomfortable part. If you keep browser information in your error tracker, your access logs or your analytics, you probably assume you can segment on that. You cannot, and the reason is a deliberate design decision that shipped years ago and that almost nobody has had cause to notice.&lt;/p&gt;

&lt;h2&gt;
  
  
  The digits you need were removed on purpose
&lt;/h2&gt;

&lt;p&gt;Chromium's user-agent reduction froze the version. From the rollout plan itself:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ship reduced Chrome MINOR.BUILD.PATCH version numbers ("0.0.0").&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The resulting format is &lt;code&gt;Chrome/&amp;lt;majorVersion&amp;gt;.0.0.0&lt;/code&gt;. Every Chrome 157 user on earth sends the same string, whether they are on .49 or .51. The three numbers that distinguish exploited from patched are replaced with zeros before the request leaves the browser.&lt;/p&gt;

&lt;p&gt;The operating system went the same way. The reduced string carries fixed literals, &lt;code&gt;Windows NT 10.0; Win64; x64&lt;/code&gt; and &lt;code&gt;Macintosh; Intel Mac OS X 10_15_7&lt;/code&gt;, with a footnote that leaves no room:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;these strings are literal values; they will not update even if a user is on an updated operating system or device&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So the column in your dashboard that says &lt;code&gt;Chrome 157 / Windows 10&lt;/code&gt; is not stale, wrong or badly parsed. It is reporting exactly what arrived, and what arrived cannot answer the question.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does carry it
&lt;/h2&gt;

&lt;p&gt;The full version still exists, through User-Agent Client Hints. The header is &lt;code&gt;Sec-CH-UA-Full-Version-List&lt;/code&gt;, described in Chrome's docs as the "List of browser brands and their full version", and it looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="nc"&gt;Sec&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;CH&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;UA&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Full&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Version&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;" Not A;Brand"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"99.0.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Chromium"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"157.0.8103.51"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In JavaScript the same value comes from a high-entropy request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;ua&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;userAgentData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getHighEntropyValues&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"fullVersionList"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;// ua.fullVersionList -&amp;gt; [{ brand: "Chromium", version: "157.0.8103.51" }, ...]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both are opt-in. The default set, in Chrome's words, is "the browser brand, significant / major version, platform" and the mobile indicator. The full version is not in it. A server has to ask, with &lt;code&gt;Accept-CH&lt;/code&gt;, and even then the docs are explicit that "it's down to the browser what values, if any, are returned".&lt;/p&gt;

&lt;h2&gt;
  
  
  The bit that actually costs you
&lt;/h2&gt;

&lt;p&gt;Read that again with an incident in mind.&lt;/p&gt;

&lt;p&gt;To know &lt;strong&gt;today&lt;/strong&gt; which of your users are on an unpatched build, you needed to have been collecting the full version &lt;strong&gt;before&lt;/strong&gt; today. &lt;code&gt;Accept-CH&lt;/code&gt; is a request for future responses. There is no query you can run against last week's logs to recover a value the browser never sent. The data was not lost or truncated. It was never generated.&lt;/p&gt;

&lt;p&gt;And it is a Chromium mechanism, so whatever share of your traffic is Safari or Firefox is outside it regardless.&lt;/p&gt;

&lt;p&gt;This is the whole shape of the problem, and it is not really about user agents:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The field you need during an incident is one somebody had to decide to collect months before the incident.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Nobody adds &lt;code&gt;Accept-CH: Sec-CH-UA-Full-Version-List&lt;/code&gt; on a quiet Tuesday. It gets added the day after the first time somebody needed it and it was not there, which is to say one incident too late. The same is true of the console output, the failed request and the exact build on the machine where a bug actually happened: all of it is free at the moment of the failure and unrecoverable about ten seconds later.&lt;/p&gt;

&lt;p&gt;A bug report that says "Chrome 157" is not inaccurate. It is simply not an answer, and this week is the week that difference has a price attached. Most weeks it does not, which is exactly why nobody notices until it does.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do before you close the tab
&lt;/h2&gt;

&lt;p&gt;Three things, in descending order of how much they are worth:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If you have any legitimate need for patch-level data, send &lt;code&gt;Accept-CH: Sec-CH-UA-Full-Version-List&lt;/code&gt; now rather than during the next one. It costs a header.&lt;/li&gt;
&lt;li&gt;Check what your error tracker actually stores. "Browser: Chrome 157" and "Browser: Chrome 157.0.8103.51" look alike in a list and are not the same record.&lt;/li&gt;
&lt;li&gt;Update your own browser, then confirm the number rather than the reassuring green text. You want 157.0.8103.50 or later, and the About page is where it is written down.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>security</category>
      <category>chrome</category>
      <category>privacy</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Safari Deletes Your LocalStorage After Seven Days, and the Clock Is Not the One You Think</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Fri, 06 Nov 2026 13:58:35 +0000</pubDate>
      <link>https://dev.to/session_replay/safari-deletes-your-localstorage-after-seven-days-and-the-clock-is-not-the-one-you-think-3dp9</link>
      <guid>https://dev.to/session_replay/safari-deletes-your-localstorage-after-seven-days-and-the-clock-is-not-the-one-you-think-3dp9</guid>
      <description>&lt;p&gt;The report is always some version of the same thing. It logged me out again. My draft is gone. The settings I picked went back to default. It worked last month.&lt;/p&gt;

&lt;p&gt;Nothing threw. Nothing is in your error tracker. The user is not doing anything unusual, and you cannot reproduce it, because on your machine it has never once happened.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule
&lt;/h2&gt;

&lt;p&gt;WebKit's tracking prevention page states it plainly:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;ITP deletes all cookies created in JavaScript and all other script-writeable storage after 7 days of no user interaction with the website.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And then it lists exactly what goes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;IndexedDB&lt;/li&gt;
&lt;li&gt;LocalStorage&lt;/li&gt;
&lt;li&gt;Media keys&lt;/li&gt;
&lt;li&gt;SessionStorage&lt;/li&gt;
&lt;li&gt;Service Worker registrations and cache&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Two entries in that list are worth stopping on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SessionStorage&lt;/strong&gt; is there, which surprises people, because session storage dies with the tab anyway. It is on the list because the rule is about the storage &lt;em&gt;form&lt;/em&gt;, not about how long you expected it to live.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Service Worker registrations and cache&lt;/strong&gt; is the one that quietly matters most. An application you built to work offline stops being registered. The next visit is a cold one: everything re-downloads, the offline fallback is gone, and nobody involved connects that to a storage policy.&lt;/p&gt;

&lt;h2&gt;
  
  
  The clock is not seven calendar days
&lt;/h2&gt;

&lt;p&gt;This is the part that makes it untestable by accident, and it is in WebKit's own announcement of the change rather than the summary page:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;the seven-day cap on script-writable storage is gated on "after seven days of Safari use without user interaction on the site"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Seven days of &lt;strong&gt;Safari use&lt;/strong&gt;. Not seven days on the calendar. A user who does not open Safari at all for a fortnight has not spent any of their seven days. A user who opens Safari constantly and simply does not visit you burns through them in a week.&lt;/p&gt;

&lt;p&gt;So you cannot test this by setting a machine aside for a week, which is the obvious experiment and the one that produces a false negative. You have to use the browser without using the site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it never happens to you
&lt;/h2&gt;

&lt;p&gt;You interact with your own site more or less daily. The counter resets every time you do, so for you the deletion is permanently seven days away and never arrives.&lt;/p&gt;

&lt;p&gt;The people it does happen to are the ones who use the product occasionally: monthly reporting, quarterly reviews, the person who logs in when something needs approving. They are also the users least likely to report precisely, because from where they sit nothing broke. It just asked them to sign in, which software does.&lt;/p&gt;

&lt;h2&gt;
  
  
  The exception that is actually useful
&lt;/h2&gt;

&lt;p&gt;If the thing is added to the home screen, the rule changes. From the same post:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Web applications added to the home screen are not part of Safari and thus have their own counter of days of use.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And WebKit is explicit about intent: a first party in such a web application having its data deleted is something they "would consider a serious bug". So the installed path has a different and much friendlier clock, which is worth knowing before anyone redesigns their auth around this.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do, and what to collect
&lt;/h2&gt;

&lt;p&gt;Do not solve it by writing more to LocalStorage. The fix is to stop treating script-writable storage as durable: anything that must survive belongs on the server behind a real session, and what stays local should be the sort of thing you can lose without the user noticing.&lt;/p&gt;

&lt;p&gt;For diagnosis, the useful signal is not an error, because there is no error. It is the shape of the session. Was this a returning user whose client-side state was unexpectedly empty? That is one boolean you can record at load, and it turns "it logged me out again" from an anecdote into a pattern with a date attached.&lt;/p&gt;

&lt;p&gt;The original reason for all this is in the same announcement, and it is fair: "APIs like LocalStorage have no expiry function at all, i.e. websites cannot even ask browsers to put a limit on how long such storage should stay around." Nobody gave the platform a way to say &lt;em&gt;this expires&lt;/em&gt;, so the platform picked a number.&lt;/p&gt;

</description>
      <category>safari</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>privacy</category>
    </item>
    <item>
      <title>Your Error Tracker Is Full of removeChild Errors From Users Who Translated the Page</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Thu, 05 Nov 2026 13:59:47 +0000</pubDate>
      <link>https://dev.to/session_replay/your-error-tracker-is-full-of-removechild-errors-from-users-who-translated-the-page-5na</link>
      <guid>https://dev.to/session_replay/your-error-tracker-is-full-of-removechild-errors-from-users-who-translated-the-page-5na</guid>
      <description>&lt;p&gt;There is a crash that shows up in every long-lived single-page app's error tracker, always with the same shape:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NotFoundError: Failed to execute 'removeChild' on 'Node':
The node to be removed is not a child of this node.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The stack is entirely inside your framework. You have never seen it locally. It arrives in clusters, from users you cannot identify, and the one piece of information that would explain it is not in the report.&lt;/p&gt;

&lt;p&gt;It is usually the browser's page translation, and the mechanism is written down.&lt;/p&gt;

&lt;h2&gt;
  
  
  What translation actually replaces
&lt;/h2&gt;

&lt;p&gt;The HTML Standard defines the &lt;code&gt;translate&lt;/code&gt; attribute as controlling whether "an element's attribute values and the values of its &lt;strong&gt;Text node children&lt;/strong&gt; are to be translated when the page is localized."&lt;/p&gt;

&lt;p&gt;Text node children. Not the element, not its &lt;code&gt;innerHTML&lt;/code&gt; as a string. The browser walks your DOM and swaps out the text nodes themselves.&lt;/p&gt;

&lt;p&gt;Your framework is holding references to those nodes. It built them, it remembers them, and it expects to find them in the same place when it next updates. After translation, the node it remembers has been replaced by a different one, so the parent it is about to be removed from is no longer its parent.&lt;/p&gt;

&lt;p&gt;Which lands exactly on the DOM Standard's wording. &lt;code&gt;removeChild&lt;/code&gt; is defined by one line:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;removeChild(child)&lt;/code&gt; method steps are to return the result of pre-removing &lt;code&gt;child&lt;/code&gt; from this.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And pre-removing opens with the check that produces your crash:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To pre-remove a node &lt;code&gt;child&lt;/code&gt; from a node &lt;code&gt;parent&lt;/code&gt;: If &lt;code&gt;child&lt;/code&gt;'s parent is not &lt;code&gt;parent&lt;/code&gt;, then throw a "NotFoundError" DOMException.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So the exception is not a framework bug and not a race in your code. It is the DOM refusing to remove a node from a parent that is no longer its parent, and something outside your application moved it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Everything is translatable unless you say otherwise
&lt;/h2&gt;

&lt;p&gt;The part worth knowing is the default, which the spec is explicit about:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The attribute's missing value default and invalid value default are both the Inherit state&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and when there is no parent to inherit from, the element's translation mode is &lt;code&gt;translate-enabled&lt;/code&gt;. Nothing opts in. Every text node on your page is a candidate, including the ones your framework is actively managing.&lt;/p&gt;

&lt;p&gt;There is a trap in the same paragraph, and it is the kind that survives code review:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;its empty value default is the Yes state&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;span translate&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;span translate=""&amp;gt;&lt;/code&gt; mean &lt;strong&gt;translate this&lt;/strong&gt;. If you have written either reaching for "do not translate", you have written the opposite of what you intended, and it parses cleanly.&lt;/p&gt;

&lt;p&gt;The opt-out is the explicit keyword:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;translate=&lt;/span&gt;&lt;span class="s"&gt;"no"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;{{ user.displayName }}&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Put it on the parts a translation has no business touching: names, identifiers, code samples, and anything your framework re-renders from a text node reference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it never happens to you
&lt;/h2&gt;

&lt;p&gt;Browsers offer to translate when the page's language differs from the user's. You build in the language you ship in, so you are never offered it, and you will not reproduce this by clicking around.&lt;/p&gt;

&lt;p&gt;That is the whole gap. The crash is conditional on a user-side setting that is invisible from inside the page, triggered by a prompt the user accepted once and does not remember, and the resulting exception names your framework rather than the cause.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to collect
&lt;/h2&gt;

&lt;p&gt;Your error tracker already has the stack, which is the part that does not help. What is missing is anything that distinguishes a translated page from an untranslated one.&lt;/p&gt;

&lt;p&gt;Two cheap fields turn the cluster into a diagnosis:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;language&lt;/span&gt;              &lt;span class="c1"&gt;// what the browser prefers&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;documentElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lang&lt;/span&gt;   &lt;span class="c1"&gt;// what you declared&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When those two disagree across most of a &lt;code&gt;removeChild&lt;/code&gt; cluster, you have your answer, and it took one line of report metadata rather than an afternoon of staring at framework internals.&lt;/p&gt;

&lt;p&gt;The deeper version of the problem is that the page was edited by something that was never going to tell it. Your own code is the last place that would notice, because from inside, nothing is wrong until the moment something is very wrong.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>i18n</category>
      <category>browsers</category>
    </item>
    <item>
      <title>`color-scheme: only` Is Not a Value, and the Line You Are About to Ship Does Nothing</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Wed, 04 Nov 2026 13:57:28 +0000</pubDate>
      <link>https://dev.to/session_replay/color-scheme-only-is-not-a-value-and-the-line-you-are-about-to-ship-does-nothing-5bm0</link>
      <guid>https://dev.to/session_replay/color-scheme-only-is-not-a-value-and-the-line-you-are-about-to-ship-does-nothing-5bm0</guid>
      <description>&lt;p&gt;Safari 27.3 beta started darkening light websites that never implemented dark mode. If you have read about it this week, you have probably also read that the way out is &lt;code&gt;color-scheme: light only&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That is correct. What nobody mentions is that &lt;code&gt;only&lt;/code&gt; on its own is not a value, and the declaration most people reach for first is dropped by the parser without a word.&lt;/p&gt;

&lt;h2&gt;
  
  
  The grammar, from the spec
&lt;/h2&gt;

&lt;p&gt;CSS Color Adjustment Level 1 defines the property like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;Name&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;    &lt;span class="nt"&gt;color-scheme&lt;/span&gt;
&lt;span class="nt"&gt;Value&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;   &lt;span class="nt"&gt;normal&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;light&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nt"&gt;dark&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;custom-ident&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;]+&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nt"&gt;only&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;
&lt;span class="nt"&gt;Initial&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;normal&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read the value line carefully. &lt;code&gt;only&lt;/code&gt; is behind &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; and a &lt;code&gt;?&lt;/code&gt;. It is an optional modifier that must accompany at least one scheme keyword. It is not an alternative to &lt;code&gt;light&lt;/code&gt; or &lt;code&gt;dark&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So this is valid, and means what you want:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="py"&gt;color-scheme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;light&lt;/span&gt; &lt;span class="n"&gt;only&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And this is not a valid declaration at all:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="py"&gt;color-scheme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;only&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;   &lt;span class="c"&gt;/* dropped */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No error, no warning, no visual difference on your machine. An invalid declaration is discarded at parse time and the property keeps its previous value, which is &lt;code&gt;normal&lt;/code&gt;. The line is in your stylesheet, your diff, your review, and it is doing nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What &lt;code&gt;only&lt;/code&gt; actually does
&lt;/h2&gt;

&lt;p&gt;The spec is one sentence: &lt;strong&gt;"Forbids the user agent from overriding the color scheme for the element."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The mechanism is in the algorithm for the used color scheme. If the user's preferred scheme is in your list, that is used. Otherwise:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;if the user has indicated an overriding preference for their chosen color scheme, and the &lt;code&gt;only&lt;/code&gt; keyword is not present in &lt;code&gt;color-scheme&lt;/code&gt; for the element, the user agent must override the color scheme&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;only&lt;/code&gt; is the one token that makes that branch not fire. &lt;code&gt;light&lt;/code&gt; alone tells the browser you support light. &lt;code&gt;light only&lt;/code&gt; tells it that it may not overrule you.&lt;/p&gt;

&lt;p&gt;Those two are a single word apart and nobody reviewing a stylesheet reads them as different things.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this was always going to happen
&lt;/h2&gt;

&lt;p&gt;The same spec explains, in a note, why browsers had been leaving pages alone until now:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Because many pages were authored before color scheme support existed, user agents cannot automatically adapt the colors used in elements under their control, as it might cause unreadable color contrast with the surrounding page.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That was the constraint. A browser could not safely recolour a page that had said nothing, because it did not know enough. A vendor that believes it now knows enough, through analysing the page rather than guessing, is no longer bound by it. One of them has decided that.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that reaches you as a bug report
&lt;/h2&gt;

&lt;p&gt;A recoloured page is a visible change with no visible cause. The user did not install anything, your deploy did not change, and the setting that did it is not one they think of as a setting.&lt;/p&gt;

&lt;p&gt;And you cannot query your way out. Safari's own documentation says it "prevents websites from detecting when Adaptive Dark Mode has been applied", and that "JavaScript that queries CSS colors will get the original authored colors, not the transformed ones". So &lt;code&gt;getComputedStyle&lt;/code&gt; reports your stylesheet, not the screen.&lt;/p&gt;

&lt;p&gt;Which means the broken-looking line above fails in the worst possible way. You ship &lt;code&gt;color-scheme: only&lt;/code&gt;, you check your own page, it looks right, because it always looked right on your machine. The declaration is invalid, the browser keeps recolouring, and the only instrument that would tell you is one the browser deliberately disabled.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two minutes that settle it
&lt;/h2&gt;

&lt;p&gt;The property reads back, even when the colours do not:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;getComputedStyle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;documentElement&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;colorScheme&lt;/span&gt;
&lt;span class="c1"&gt;// "light only"  -&amp;gt; parsed, you are opted out&lt;/span&gt;
&lt;span class="c1"&gt;// "normal"      -&amp;gt; your declaration was dropped&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That works because the computed value of &lt;code&gt;color-scheme&lt;/code&gt; is, per the spec, "the keyword &lt;code&gt;normal&lt;/code&gt;, or an ordered list of specified color scheme keywords". It is reporting what the parser kept, which is exactly the question. It is not reporting any colour, which is the question the browser will not answer.&lt;/p&gt;

&lt;p&gt;Check the string, not the screen.&lt;/p&gt;

</description>
      <category>css</category>
      <category>browsers</category>
      <category>webdev</category>
      <category>frontend</category>
    </item>
  </channel>
</rss>
