Urgent.News

What's breaking now, across thousands of outlets.

Tech

Ctrl+A Only Copied a Third of the Page, So I Built a Chrome Extension

I was trying to save a lesson from an interactive course into my notes. You know the type. Slides you click through, cards you flip to see the answer, boxes that open up when you tap them, plus the normal static text around all of it. I did what anyone would do. Ctrl+A, Ctrl+C, paste into Notion. About a third of the content showed up. The slides were missing, the flip cards gave me the front and…

A software developer was copying content from an interactive online course into their notes. They tried using Ctrl+A, Ctrl+C, but only a third of the content copied over. The problem was that the hidden slides, flip cards, and reveal boxes were intentionally not showing up in the rendered page. The developer discovered that the HTML contained all the content, but it was being hidden with CSS.

The solution was to read the DOM directly instead of relying on the browser's selection. They created a script that traversed every text node on the page and copied it to the clipboard. The developer initially tried this in the browser's Developer Tools console, but found it annoying to open the console every time they needed to copy content.

So, they turned the script into a Chrome extension. The extension provides a simple button that injects the extraction function into the current tab and copies the text to the clipboard. The developer learned several things during the process, such as the importance of writing self-contained functions, writing to the clipboard from the popup, and walking the shadow roots to include content inside shadow DOM elements.

The extension outputs rough markdown, including headings, list items, and table rows, making it easy to paste into Notion or other note-taking apps. The developer found that the extension works well on most pages but has limitations, such as not being able to read lazy-loaded content or text inside images. They are considering adding a keyboard shortcut and an option to automatically click through "next" buttons, but are unsure about the potential challenges.

The extension's code is available on GitHub for those interested in using or contributing to the project.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Docker Compose build must be a string, in CI

Docker Compose build must be a string is the schema validator naming one branch of a rule with two, and following it literally will send you to rewrite a mapping that was never the problem.

  • "Docker Compose build must be a string" error occurs
  • Invalid key type or mapping branch causes the error
  • Validate Compose files in CI to prevent the error

How to Sync Billing Data to Prisma Postgres (Stripe, QuickBooks, Xero & Paddle)

Sync Stripe, QuickBooks, Xero or Paddle into Prisma Postgres. Which connection string to use, how a batched sync counts operations, and what it costs.

  • Prisma Postgres bills per operation, not query duration, making it cost-effective for batch syncs
  • Recommended pooled connection string for background workers like scheduled syncs
  • Sync of 375 Stripe paymentintents costs only 15 operations, demonstrating efficiency

Turning noisy bathroom-scale data into a projected date: SMA vs. EMA vs. linear regression

Body weight is a terrible time series. On a single morning it can swing by a kilogram or more because of water, salt, glycogen and whatever is still in your gut.

  • Simple moving average (SMA) calculates 7-day average weight, lagging about 3 days
  • Exponentially smoothed moving average (EMA) uses 10% smoothing factor, slower to respond
  • Linear regression estimates daily weight change, provides date estimate but assumes constant rate

Building a read-aloud screen: phrases, tappable words and a finger that drifts

Background A lot of what I read is still on paper: letters from the bank, school handouts, a recipe, a library book. I often want to listen to them instead, and I want to follow the words while I…

  • Outloud Reader app highlights phrases, tappable words, and offers just listen mode
  • Phrases consist of up to four words up to punctuation mark, highlighted as soft yellow plate
  • Custom SwiftUI Layout enables precise word control, hit-testing, and overlapping plates

Korean input kept breaking in Android terminals with a physical keyboard, so I built my own

I use a tablet with a physical keyboard and Gboard. Every time I typed Korean into an Android terminal app, composing input broke — syllables got eaten mid-composition or committed wrong.

  • User experiences Korean IME breaking in Android terminals with physical keyboard
  • Developer creates TermiPlus to solve Korean input issues
  • TermiPlus offers Korean input, SSH, and local terminal functionality

My Entire Company Costs About $10 a Year. Here's Every Line Item.

My company made about as much as it cost to exist, and it had a subscription habit: tools I used once and kept paying for.

  • $10 annual cost includes domain, cloud services, email, and Gumroad fees
  • Free tiers from Cloudflare, Brevo, and Gumroad cover all expenses
  • Building trust with customers is the real challenge beyond the $10 stack

More from Sunday 15 November →