Show a reader file opened in a browser tab with an extension

Open
#205 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript
Domain
frontend

Research direction

Start by reading the dependencies #201, #202, and #203, and compare the extension requirements with the hosted viewer in #204. The issue names no implementation files, so first locate the viewer and preview-frame entry points in the repository. Done means the extension builds, has a page in docs/, and passes a security review covering the viewer frame, messaging, and fetches.

Written by the indexing model from the issue text.

Description

enhancement

Part of #201. Needs #202 and #203, and shares most of the hosted viewer (#204).

A browser extension (Manifest V3, so one codebase for Chrome, Edge and Firefox) shows a .md file that's opened in a tab as reader would.

Telling a reader file apart. A content script runs on .md URLs that come back as text/plain or text/markdown, and checks the file's front matter:

  • reader: or type: slides|workbook: render it.
  • Any other markdown: leave it as text, with a Render with reader button. It doesn't guess, just as reader takes nothing from a page's --- breaks or notes. A site can be set to always render.

Rendering inside the extension. Many hosts serve raw files under a strict Content-Security-Policy (raw.githubusercontent.com sends default-src 'none' and sandbox), so nothing is run on the host's page. The content script puts an iframe of the extension's own viewer in place of the text and posts the source into it, much as the app posts a document into the preview frame. The address bar keeps the file's URL.

Everything else is the hosted viewer's: Work, presenting, a relative .md link opening in reader, saving what's filled in, Save my copy.

Done when

  • The extension builds from this repository and has a page in docs/.
  • The extension renders files from any site, so it gets a security review of its own before it's published: what runs in the viewer frame, what the frame and the content script accept from each other, and what a file can make the viewer fetch.
Dominant language
JavaScript
Stars
0
Forks
1
Avg merge
2d 4h
Merged PRs (30d)
26

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jzheaux/reader

All issues in jzheaux/reader

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.