• Stars
    star
    528
  • Rank 83,363 (Top 2 %)
  • Language
    Java
  • License
    MIT License
  • Created over 12 years ago
  • Updated 20 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A browser extension to copy tabs and links as Markdown

Copy as Markdown for Chrome & Firefox

Do you often type Markdown code manually for a link or image, or even all tabs in a window, and feel tired? Copy as Markdown can help you!

Download

Features

Copy as Markdown is a browser extension helps you copy the following things as Markdown to your system clipboard:

โ˜‘๏ธ Current Tab as Link
โ˜‘๏ธ A Link in the Page
โ˜‘๏ธ An Image in the Page
โ˜‘๏ธ An Image that is wrapped with a Link
โ˜‘๏ธ All Tabs as a List of Links
โ˜‘๏ธ Highlighted Tabs as a List of Links

Keyboard Shortcuts

You can add keyboard shortuts for copying tab(s) as Markdown. By default, Copy as Markdown does not assign any keyboard shortcuts.

Firefox

Please refer to this Firefox Help: https://support.mozilla.org/en-US/kb/manage-extension-shortcuts-firefox

Chrome

The Keyboard Shortcuts of extensions can be found at chrome://extensions/shortcuts URL. (Paste and open the link in the Location Bar).

Known Issues

  • [Chrome] When copying an image, the image code does not include the alternative text of that image. This is due to API restriction.

Development

Here is the forder structure. Platform-specific folder is used to resolve browser inconsistencies.

src/               # Shared Source Code
  background.js
  ...
chrome/            # Chrome / Chromium files
  dist/            # ../src will be copied here
  mainfest.json
  ...
firefox-mv2/       # Firefox Manifest V2 files
  dist/            # ../src will be copied here
  mainfest.json
  background.html  # Loads ESModule
  ...
firefox/           # Firefox Manifest V3 files
  dist/            # ../src will be copied here
  mainfest.json
  background.html  # Loads ESModule
  ...
compile.sh         # Copies src/**/* to <platform>/dist/

Install dependencies

npm install -g web-ext
npm install

Debugging

Since the source code are copied to platform-specific folders by compile.sh, it is recommended to use the auto-reload test script.

npm debug-chrome
npm debug-firefox
npm debug-firefox-mv3   // Requires Firefox Developer Edition

For manual debugging without auto-reload:

  • Chrome: [Window] Menu -> Extensions -> Load unpacked extension
  • Firefox: [Tools] Menu -> Add-ons -> [Gear] Icon -> Debug Add-ons -> Load Temporary Add-on

Debug with Firefox XPI Package

To debug some behaviors such as Firefox restarts (for example, are context menus installed properly), it is necessary to build an XPI package and install it on Firefox. Temporary Add-Ons won't be enough because they get uninstalled after Firefox quits.

Firefox checks signature when installing XPI. To do so,

  1. Grab API keys from Firefox Add-On
  2. Bump version in manifest.json. Note that AMO only accepts version number in X.Y.Z format where all 3 segments are numbers without zero prefix.
  3. Run:
    web-ext sign --channel=unlisted --api-key=... --api-secret=...

It'll create an XPI that is signed with your Firefox Add-Ons account. The file will also be uploaded to Add-On Developer Hub as unlisted.

Note that Firefox Add-On keeps track of all the versions that has ever been uploaded, including 'self-distributed' (channel=unlisted).

See https://extensionworkshop.com/documentation/develop/getting-started-with-web-ext/

Tests

Unit tests are written in mocha, ./test/**/*.test.js.

To run, use npm test.

QA

There is a qa.html that includes various edge test cases. Open it in the browser, then try Copy as Markdown with the content in it.

License

See MIT-LICENSE.txt

More Repositories

1

oauth2-api-sample

Demos how to protect Grape API with OAuth 2.0 built with Doorkeeper
Ruby
96
star
2

no-wang-wang

่‡ชๅ‹•ๆ‹’็œ‹ๆ—บๆ—บไธญๆ™‚้›†ๅœ˜ๆ——ไธ‹ๆ‰€ๆœ‰็ถฒ่ทฏๅช’้ซ”
JavaScript
48
star
3

rime-boshiamy

ๅ˜ธ่ฆ็ฑณ for ไธญๅทž้Ÿป (RIME) ็ณปๅˆ—่ผธๅ…ฅๆณ•
Shell
29
star
4

git-io-shortener

Shorten GitHub URL with Git.io in one click. (a Google Chrome extension)
JavaScript
29
star
5

no-per-script-font

No Per-Script Font! Chrome & Safari Extensions that stops per-script font fallback
JavaScript
28
star
6

vscode-coffeescript-support

Advanced CoffeeScript support in VSCode
TypeScript
28
star
7

mobile_view

Easily specify mobile-specific view template for mobile devices in Rails application.
Ruby
14
star
8

hikkoshi

Hikkoshi the Blog Migration Tool
Ruby
8
star
9

medium-to-jekyll

A CLI to convert Medium posts to Jekyll format
JavaScript
7
star
10

podcast-utils

Utilities for Podcast Production
Shell
6
star
11

kbl-generator

KKBOX Playlist (KBL) Generator
Ruby
6
star
12

dotfiles

My shell configurations
Shell
5
star
13

font-awesome-cheatsheet

Font Awesome Cheat Sheet for Dash
Ruby
5
star
14

markdown-highlight-extended-filter

An HTML::Pipeline filter to convert Octopress-flavored syntax highlighting
Ruby
4
star
15

coffeescript-lsp-core

Core library for CoffeeScript Language Server Protocol
TypeScript
4
star
16

macmoney-to-moneywiz

MacMoney to MoneyWiz 2 Converter
Ruby
4
star
17

paomateng

Subtitles editor for audio files
JavaScript
3
star
18

R3versi

Terminal Reversi Game
C
3
star
19

sassdoc

Sass Document Generator (Proof-of-Concept)
Ruby
2
star
20

test-workshop

Rails Testing Workshop
Ruby
2
star
21

apfs-docker-unicode-poc

APFS & Docker: Accented Latin and Japanese Kana Compatibility PoC
1
star