#JavaScript
11 items tagged “JavaScript”
MutationObserver re-triggers on your own injected DOM — guard against it
TIL a MutationObserver watching a third-party page fires again on the elements your own extension code just injected, causing an infinite injection loop unless the injection function is idempotent.
nvim-log-insert: A Neovim Plugin That Writes Your console.log Statements For You
A tiny Lua plugin that inserts a detailed console.log — file, line number, function, and variable name — with a single leader keymap.
Recaho Dispatcher Extension: Engineering a Browser Extension That Streamlined Dispatch Operations
A Chrome extension that injects a live operational dashboard and workflow automation into an existing dispatch platform, with zero backend access or modification.
Writing a Reliable Regex for Extracting Delivery Times
TIL that a regex tuned against a handful of examples ('DELIVERY TIME: 2:00 PM') broke on real data within a day because of extra whitespace and inconsistent AM/PM casing I hadn't accounted for.
Extracting Delivery Information from Dynamically Rendered HTML
TIL that a content script querying the DOM immediately on page load found nothing, because the POS's order details render client-side, after the content script's own 'document_idle' point had already passed.
Recaho Helper Chrome Extension
Browser extension that improves productivity while working inside Recaho.
Injecting Custom UI Into a Website You Don't Own
TIL that a naive injected panel kept getting wiped out by the host page's own re-renders — the fix was watching for that, not fighting it, and mounting into a container the host page has no reason to touch.
Reading Data from an Existing Web App with a Chrome Content Script
TIL that a content script reading order data straight from the DOM breaks every time the POS ships a markup change — the fix was reading from the most stable layer available, not the most convenient one.
Building a Chrome Extension with Manifest V3
TIL that MV3's move from persistent background pages to event-driven service workers means you can't hold long-lived in-memory state the way old extension tutorials assume — it gets killed and restarted constantly.
Converting API Timestamps to the User's Local Time Instead of Hardcoding Dubai Time
TIL that hardcoding a UTC+4 offset for timestamps because most orders happened to be local worked right up until a driver or a server ended up in a different timezone.
Moving from PHP to React: What Actually Changes
TIL the hard part of moving from PHP to React isn't JSX syntax — it's unlearning page-per-request thinking and stopping the urge to mutate the DOM yourself.