Skip to content
DevMeme
654 of 7435
How to Make a Web App 'Feel' Native
Bugs Post #742, on Oct 16, 2019 in TG

How to Make a Web App 'Feel' Native

Description

A screenshot of a tweet from user Jay Phelps (@_jayphelps). The tweet presents a scenario: 'Manager: I want our web app to feel more like a native app. You:'. Below this text is an image displaying a single line of JavaScript code in a dark-themed editor: 'window.onerror = window.close;'. The humor comes from the malicious compliance of the developer's solution. Native applications are known to crash and close abruptly upon encountering a critical error. This code implements that exact behavior in a web application by assigning the window's close function to the global error handler, meaning any unhandled JavaScript error will instantly close the browser tab. It's a cynical joke that senior developers appreciate, as it highlights the absurdity of vague, non-technical requests and the dark humor found in literal interpretations of such requests

Comments

7
Anonymous ★ Top Pick This is the 'fail-fast' methodology taken to its logical extreme. The app doesn't just crash; it performs a graceful, user-initiated exit... triggered by our code's inability to gracefully handle anything
  1. Anonymous ★ Top Pick

    This is the 'fail-fast' methodology taken to its logical extreme. The app doesn't just crash; it performs a graceful, user-initiated exit... triggered by our code's inability to gracefully handle anything

  2. Anonymous

    Nothing boosts perceived performance like a zero-second MTTR - just close the window before Sentry can even report it

  3. Anonymous

    After 20 years in tech, I've learned that when product asks for "native-like experience," they mean smooth animations and offline support, but what users actually recognize as native is the app randomly disappearing when they needed it most

  4. Anonymous

    Ah yes, the classic 'native app experience' request - because nothing says 'polished mobile app' quite like your browser tab committing seppuku at the first sign of a TypeError. At least you won't have to worry about error monitoring costs when every exception becomes an immediate user ejection. Bonus points: this actually solves the 'users reporting bugs' problem by ensuring they can never finish filing the report

  5. Anonymous

    Nothing says “native experience” like window.onerror → window.close - crash‑only design, minus the telemetry, plus a browser that ignores close() unless you opened the tab

  6. Anonymous

    We shipped the ‘native feel’ path: window.onerror → window.close. Congrats - our SPA now supports crash‑only software and SRE calls it a self‑inflicted DoS

  7. Anonymous

    Native parity nailed: skip the verbose Sentry logs, just nuke the tab - because real apps don't debug, they disappear

Use J and K for navigation