Skip to content
atha-rvPublic

About

Extract content from any website in a click

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Boxgrab

Stop dragging across text. Grab the object.

Web pages are built from blocks: tables, cards, lists, comments, code samples, articles, figures.

Browser selection pretends they are all one endless stream of characters.

Boxgrab fixes that.

Turn it on, hover over anything, and Boxgrab finds the block underneath your pointer. Dashed rails mark its boundaries. Click once and the whole object lands on your clipboard with its structure intact.

A table stays a table. A list stays a list. A four-screen article stays grabbable even when most of it is outside the viewport.

One hover. One click. Whole block.

Install

Open boxgrab.html in a browser and drag the Boxgrab button to your bookmarks bar.

The page also includes a Try it on this page button, so you can test the boundary engine against real content before installing it.

On mobile, copy the bookmarklet source from the page and paste it into the URL field of a new bookmark.

Use

  1. Click the Boxgrab bookmark.
  2. Your cursor becomes a crosshair.
  3. Hover over the object you want.
  4. Click once to copy the whole block.
  5. Press Esc to stop.

Clicking the bookmark again also turns Boxgrab off.

The rails

As you move across a page, two dashed rails track the left and right edges of the active block.

The top and bottom boundaries appear when they enter the viewport.

This matters for large objects. A block can run several screens tall and still remain selected because the rails persist while you scroll through it.

You never have to drag from the first line to the last.

How Boxgrab chooses the box

The block under your cursor is not always obvious.

A sentence may sit inside a paragraph, inside a card, inside an article, inside a page shell. Boxgrab resolves that ambiguity using three rules.

1. Real objects win

Tables, lists, figures, blockquotes, code blocks, and media elements receive priority.

Boxgrab searches up to eight levels above the element under your cursor. When multiple real objects qualify, the outermost candidate wins.

Hover over a table cell and you get the table.

2. Empty wrappers collapse

Pages contain layers of containers used only for spacing, layout, or styling.

Boxgrab climbs through parents that add little content of their own, using a 15% text-length threshold.

The goal is to land on the paragraph, card, comment, or article instead of a decorative shell around it.

3. Slivers grow

Tiny fragments usually belong to something larger.

An element containing fewer than 25 characters and measuring less than 24 pixels tall hands the selection to its parent.

Hover over a label and Boxgrab is more likely to give you the complete row, card, or control around it.

These three rules cover most pages without adding controls to every interaction.

Some pages will remain weird. That is deliberate.

Every additional exception makes the engine slightly smarter and the act of using it slightly worse. Boxgrab protects the input side: hover once, click once, leave.

What reaches the clipboard

Boxgrab writes two clipboard formats at the same time using ClipboardItem.

Format Best for What you get
text/html Word, Google Docs, Notion, Sheets, Excel Structure and formatting
text/plain Editors, terminals, chat boxes Clean tab-separated text

Copy a table and paste it into Excel: it arrives as cells.

Paste the same grab into a terminal or chat box: it arrives as readable plain text.

There are no format menus because the destination already knows what it needs.

Whole box means whole box.

Clipboard fallback

Some pages reject modern clipboard writes.

When that happens, Boxgrab falls back to creating a range selection and calling execCommand('copy').

If both methods fail, Boxgrab shows a toast explaining that the page blocked the copy.

Where it misses

Boxgrab works with the structure the page provides, so a few classes of pages can still defeat it.

  • A visual object split across unrelated containers may be copied in pieces.
  • Content inside an iframe belongs to that frame. Trigger Boxgrab from inside the frame itself.
  • Strict content security policies can block bookmarklets entirely. GitHub is one example.
  • Highly virtualized applications may destroy and recreate elements while you scroll.

An extension version can run with greater privileges and escape several of these limits. That is the natural next build.

Why Boxgrab exists

Most browser work collapses into two actions:

Scanning and taking.

Scanning has Ctrl+F. It is thin, but it exists.

Taking still relies on dragging across a continuous stream of characters, even though the page already knows exactly where every table, paragraph, card, comment, figure, and article begins and ends.

The browser has the structure. The selection model ignores it.

Boxgrab exposes that structure as an action.

Its invariant is simple:

Pages are made of discrete blocks. Selection should address blocks.

Swap the content for a table, a code listing, a comment thread, or a 4,000-word article. The mechanism stays the same.

Hover. Click. Take the object.

What stayed out

Two features were deliberately excluded from this build:

  • Widen and narrow controls for adjusting the boundary
  • Advertisement filtering

Both sound useful. Both move complexity back onto the user.

The value of Boxgrab lives in its tiny input surface. Once every grab becomes a negotiation with the tool, the tool has already lost.

Files

File Purpose
boxgrab.src.js Readable source in one dependency-free IIFE
build.js Encodes the source as a bookmarklet and builds the install page
page.tpl.html Template used to generate the install page
boxgrab.html Built install page with the live demo and embedded source

Rebuild the install page with:

node build.js

The family

Boxgrab belongs to a family of small browser engines. Each one gives the page a capability the browser left out.

Findlet handles scanning. Flowcap handles repeating. Boxgrab handles taking.

Small tool. Stable mechanism. One missing browser verb returned.

Licence

Released under the MIT licence.

Fork it, modify the boundary rules, build it into an extension, or turn the engine into something stranger.

About

Extract content from any website in a click

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages