Coder Social home page Coder Social logo

roosta / yank Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 1.0 548 KB

A Firefox extension to copy current tab URL and title to clipboard, formatted for a markup language. Supports several different markup languages.

Home Page: https://addons.mozilla.org/en-US/firefox/addon/yank/

License: MIT License

JavaScript 80.43% Shell 1.47% CSS 8.80% HTML 9.29%
addons-mozilla-org asciidoc firefox html latex markdown markup org-mode restructuredtext textile

yank's Introduction

[ yank ]

A Firefox extension to copy current tab URL and title to clipboard, formatted for a markup language. Supports several different markup languages.

Usage

Click on the extension in the toolbar, opening a popup. From there you can choose a markup format (default markdown), then click the button to copy to clipboard.

Yank can also be used as a command (keyboard shortcut), and can be configured in Firefox about:addons. Click the preferences icon and click Manage Extension Shortcuts, and configure your preferred shortcut. Default is Ctrl+Y

There is also a context menu option, that allows for copying an anchors href and content.

Supported formats

Yank currently supports these markup languages:

Permissions

The full list of permissions is:

  • activeTab,
    • Needed to get the title and URL that gets copied
  • clipboardWrite,
    • Needed to write to clipboard, reading is never done
  • contextMenus,
    • Needed to enable context menu to copy links on page
  • storage
    • Needed to save format. Its saved in local storage, and is not synced with account (anymore)

Dependency free

Since version 2.0.0 the yank extension doesn't bundle any dependencies, there are only development dependencies.

Development

git clone https://github.com/roosta/yank && cd yank && npm install

Run npm run dev to start a concurrent webpack and web-ext watch processes. It'll open Firefox and a debugger. See ffdev.sh launcher script, change it to match your preferred setup.

Release

Run npm run prod to build webpack, package using web-ext

See package.json scripts for details on each individual step

Testing

I've manually doubled checked each format using this string:

<my> {fancy} "title" \\with\\ [ chars ] backtick(`), tilde(~), underscore(_), amp(&), dollar($), uptick(^)';

That string runs through all the usual suspects, then I will check the result with a parser depending on the format.

Automating this might be possible but IMO not worth the effort, and would be needlessly complicated. Might setup some unit tests later for various functions, but for now I'm satisfied with manual testing.

License

MIT

yank's People

Contributors

roosta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

nicolaus1990

yank's Issues

Please build the .xpi file for the latest release and updates

Dear Roosta,

Thank you very much for this useful firefox extension!

a few requests and suggestions:

  1. I don't know how to build this extension. Please build and upload the .xpi file for the latest release and updates.

  2. Now the shortcut key Ctrl+y copies URL in org-mode format. can it jump to emacs as well?

many thanks!

Hung

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.