Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 1, 2026

Implements a Chrome browser plugin that automatically renders .md files (local and remote) with GitHub-flavored markdown styling.

Implementation

  • manifest.json: Manifest V3 extension config with content script injection on all URLs
  • content.js: Detects .md files by URL extension, extracts raw content, parses with marked.js, replaces DOM with styled HTML
  • markdown.css: GitHub-inspired responsive styling (headers, code blocks, tables, lists, blockquotes, task lists)
  • marked.min.js: GFM-compatible markdown parser (41KB)
  • Icons: 16/48/128px PNG assets

Usage

After loading the unpacked extension:

  • Navigate to any .md URL (remote: https://example.com/README.md, local: file:///path/to/file.md)
  • Extension auto-detects and renders with formatting
// Core detection and rendering logic
if (pathname.toLowerCase().endsWith('.md')) {
  const markdown = document.body.textContent;
  const html = marked.parse(markdown);
  document.body.innerHTML = `<div class="markdown-body">${html}</div>`;
}

Screenshots

Before (raw text):
Raw markdown

After (rendered):
Rendered markdown

Notes

  • Runs entirely client-side, no external API calls
  • Local file access requires enabling "Allow access to file URLs" in extension settings
  • Supports all standard markdown features (nested lists, code blocks, tables, task lists, etc.)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn.jsdelivr.net
    • Triggering command: /usr/bin/curl curl -o marked.min.js REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Implement a chrome browser plugin to render any local or remote markdown file ending with a .md file extension


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits January 1, 2026 23:33
Co-authored-by: LFDave <36726874+LFDave@users.noreply.github.com>
Co-authored-by: LFDave <36726874+LFDave@users.noreply.github.com>
Co-authored-by: LFDave <36726874+LFDave@users.noreply.github.com>
Copilot AI changed the title [WIP] Add chrome browser plugin for rendering markdown files Add Chrome extension for rendering markdown files Jan 1, 2026
Copilot AI requested a review from LFDave January 1, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants