Skip to content
meehowPublic

About

Convert article in current tab to readable form and upload it to P2P network - IPFS

Topics

Resources

Stars

148 stars

Watchers

3 watching

Forks

Latest commit

 

History

63 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2read

A browser extension that saves the article in the current tab as a clean, readable page on IPFS and bookmarks its permanent link.

The 2read popup: a preview of the article, the choice of Serif, Sans or Compact, and the Save article button

Add to Firefox | Add to Chrome | 2read.net

  • Ads, menus and other page furniture are removed
  • Pictures are stored with the text, nothing loads from the original site
  • Formulas are kept, on Wikipedia and on sites that use MathJax or KaTeX
  • Three reading styles: Serif, Sans and Compact, each with a dark mode
  • The link is a content address, so it can never lead to a different text
  • No account and no setup

What happens when you save

  1. Opening the popup injects two things into the current tab: Mozilla's Readability (the unmodified 0.6.0 file) and the extraction function from src/background.js. Nothing runs on any page before that.
  2. Readability finds the article. The extraction function then repairs what Readability gets wrong on real pages:
    • the lead picture is kept when it sits outside the article text
    • formulas survive, and pictures that a page stacks from several layers are put back together
    • ads, navigation and "related" boxes that Readability lets through are dropped
    • stand-in pictures from empty ad slots and lazy loaders are dropped
    • from a srcset the largest candidate up to 1600 px wide is taken
  3. The popup shows the title, the site and the number of pictures. Nothing has left the browser yet.
  4. On "Save article" the background script downloads the pictures (up to 200, 5 MB each, 20 MB together) and posts them with the cleaned text to ipfs.2read.net.
  5. That server builds the page in the chosen style, removes scripts and other active content, pins the result on its IPFS node and announces it to the network. It answers with the CID.
  6. The extension opens https://inbrowser.link/ipfs/<CID>/ in a new tab and bookmarks it. inbrowser.link is a gateway that fetches and verifies the content inside your browser.

Permissions

Permission Why it is needed
activeTab, scripting Read the article from the current tab when you open the popup.
bookmarks Create the bookmark for the saved article. Existing bookmarks are never read.
Access to all sites Articles embed pictures from many other hosts. The extension has to download them itself to store them with the article, because a page cannot hand over pictures that come from another host.

What is sent, and what is public

Nothing is sent until you press "Save article". Then the address, the cleaned text and the pictures of that one page go to ipfs.2read.net. There are no accounts and no analytics.

Saved articles are public. Anyone who has the link or the CID can read them, so do not save pages that are meant for you alone. To have an article removed from the server, open an issue with its link.

Keeping your own copy

Every saved article has a CID, the long identifier in its link. Anyone running an IPFS node (for example IPFS Desktop) can keep a full copy that does not depend on 2read:

ipfs pin add <CID>

Development

There is no build step. src/ is the extension as it ships.

Path What it is
src/background.js Extraction, picture download, upload, bookmark
src/popup.* The preview and the style choice
src/Readability.js Mozilla's Readability, unmodified
art/icon.svg The icon. make icons renders the PNG sizes from it
docs/ The website, 2read.net, served by GitHub Pages
PUBLISHING.md Release checklist and the answers for both stores

To try a change, load src/ unpacked:

  • Chrome: chrome://extensions, switch on developer mode, "Load unpacked", pick src/.
  • Firefox: about:debugging, "This Firefox", "Load Temporary Add-on", pick src/manifest.json.

Then:

  • make lint checks the extension with Mozilla's web-ext.
  • make release packs the committed src/ into 2read.zip for the stores. One commit always gives the same file, byte for byte.

It needs Chrome 121 or Firefox 140, or newer.

The website is plain HTML and CSS without a build step either. The files in docs/styles/ are the stylesheets that saved articles get, so the site can show the three reading styles as they really are.

Release notes

  • v2.0 - works again. Manifest V3, own storage server instead of the public writable gateways that no longer exist, images and styles stored with each article, updated Readability. A preview before anything is saved, three reading styles, dark mode and formulas
  • v1.8 - copy articles to Mutable File System (MFS)
  • v1.7 - serious speedup, more gateways added, automatic fastest gateway selection, image pre-seeding

License

GPL-3.0. src/Readability.js is Mozilla's and comes under the Apache License 2.0.

About

Convert article in current tab to readable form and upload it to P2P network - IPFS

Topics

Resources

Stars

148 stars

Watchers

3 watching

Forks

Used by

Contributors

Languages