Coder Social home page Coder Social logo

codecopy's Introduction

CodeCopy

Because copy to clipboard buttons should exist on every code snippet.

Banner

Install

This browser extension available for:

Chrome logo Firefox logo
Chrome Firefox

Supported sites

Works with:

And more.

If you want to add a new site, feel free to send a pull request :)

Custom domains

You can also enable CodeCopy on custom domains or Github Enterprise. Right click on CodeCopy's icon in the the toolbar and select Enable CodeCopy on this domain.

Preview

Preview

Setup

Install dependencies:

npm install

Compile scripts and styles:

npm start

Testing

Chrome
  1. Navigate to chrome://extensions

  2. Click on Load unpacked extension...

  3. Select the dist folder

Firefox
  1. Navigate to about:debugging

  2. Click on Load temporary Add-on

  3. Select the manifest.json inside the dist folder

Opera
  1. Navigate to extensions

  2. Click on Developer Mode

  3. Click on Load unpacked extension...

  4. Select the dist folder

License

MIT License © Zeno Rocha

codecopy's People

Contributors

caiochagas avatar dependabot[bot] avatar glennmen avatar pascalcompiles avatar realcyguy avatar zenorocha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codecopy's Issues

Useable as a module?

Hey @zenorocha. I'd love to drop something like this into electronjs.org. Can it be used as a module? If not, maybe that's a use case worth supporting?

Remove GitHub since it has native support

GitHub now has a button natively, so it’s no longer useful to have this button on Markdown pages (and it didn’t show up anyway). Note that #1 is still interesting though, so we may want to keep the domain permission.

Button on left side of code

Would it be possible to place the button to the left of the code? In all preview examples there is more space between the code and the button, than there is code in the block ;-) Shave off some meters of mouse movement per day?

Tested this successfully on Edge Browser

I have tested this plugin on Edge browser on Ubuntu 20.04. It works as expected without any code changes. I tried this with some custom domains like Python Flask and it works great. Attached screenshots for the same
Python Flask Page
Edge Extensions Page
.

Why has CodeCopy been removed from Chrome Web Store?

README.md contains a link to CodeCopy listed on Chrome Web Store, but it redirects to a 404 page.

Apparently, CodeCopy has been automatically disabled on my browser (Edge Chromium) saying that

This extension has been disabled because it's been marked unsafe by the Chrome Web Store.

image

Does this relate to the removal of CodeCopy from Chrome Web Store?

Different spacing above and below code blocks

This is a visual bug: when it’s enabled, the spacing above code blocks is larger than the one below them. Screenshot:
圖片

A possible fix is to change <div class="codecopy"> into a <p>, to make use of the existing CSS rules.

use with TiddlyWiki

@zenorocha, could you please explain how to add a site. Tried to just stick my URL to matches in manifest.json, that didn't work. I want to use this on a self-hosted TiddlyWiki.

Support for Independent Javascript Library (Not as Browser Extension)

I've been digging to find a JS library that will add this natively to a web app, rather than a user having to install an extension in their browser. It would be great if this project also supported that use-case, rather than creating/forking a new project.

Ideally, I would be able to just import this library locally, or from something like CDNJS and load it on any web app. Similar to how highlight.js works:

Context: In some use-cases, users are required to disable all browser extensions before proceeding with a task (ex: taking an exam/certification/etc using an online proctoring service).

show the copy icon always

the copy icon is show when the mouse is hover on the element, can you add an option to allow show copy icon always in the code element?

GitHub Enterprise?

Can this be made to work on GitHub Enterprise instances? I've never investigated how similar they are code-wise, but the front ends are basically identical.

You'd probably have to add an option to specify the domains to run on. The two enterprise instances I use are at github.company_domain.com

[BUG] "Enable CodeCopy on this domain" not available

The documentation states that custom domains can be added by right-clicking on the extension and choosing "Enable CodeCopy on this domain".

https://github.com/zenorocha/codecopy#custom-domains

I have installed the extension on multiple browsers (Chrome and Brave) on multiple OSes (Linux and OSX), and am unable to get this option to show up. Right-clicking on the extension gives the same context menu as left-clicking, and there is no "Enable CodeCopy on this domain".

Does `copycode` also work with Gist snippets?

Hi @zenorocha

many thanks for this awesome piece of software. I have embedded codecopy with my blog and it works well. This is rather a question than an issue though ;)

I embed some Gist snippets in my posts but don't know how to enable codecopy on those snippets. Would you mind to share some hints?

Btw, I visit Gist site but the code snippets don't have the copy icons (whilst code blocks on the other sites like SO, Github do).

Thanks a lot.

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.