Copy text/codes in a click from any site
Tags: javascript, webdev, beginners, programming
Published: 2022-01-17 10:22:45

We often copy text or code snippets or any other kind of resource quite commonly while browsing the web. Copying sometimes got to be tedious work in certain situations.


Using keyboard shortcuts quite often for various tasks is found to be a great time-saver in the long run. But certain people who are not much used to a keyboard, like using the mouse for all their small to big activities in the browser.


Copying and pasting text with the shortcuts `Ctrl + C` and `Ctrl + V`  are the world's highly used shortcuts and these shortcuts are known almost to all the people who use a computer.

> Do you remember yourself copying text with `Ctrl + C C C C C C C`, typing C multiple times to make sure the text gets copied?


Sometimes we tend to put a bit more time even with copy shortcuts. When you want to copy text just so frequently, let's say you want to shift a formatted text from one place to the other and that can be copied only as paragraphs and not as a whole, in such situations, copying and pasting text with even shortcuts is going to be a very tedious job. Not just this case but in any case that involves frequent copying and pasting text gets tedious even with shortcuts.


So keeping in mind various contexts involved in copying text, a small and compact chrome extension is made to _[Copy Text Easily](https://devapt.com/copy-text-easily)._


Using Copy Text Easily(CTE) extension effectively has the potential to save a lot of time in the long run for those who involve in copying text just so frequently. e.g., Students copying reference details to their journals, etc.


Let's see all the features which this Copy Text Easily extension provides.

## Copy Text Easily extension
Before getting started to use this Copy Text Extension, you need to first install it from the chrome store. You can install the extension from this link [Copy Text Easily Extension](https://chrome.google.com/webstore/detail/copy-text-easily/fagmaopcbeobbfhkeodicjekiniefdlo).


### CTE chrome extension has got three modes for copying text

1. Paragraph(default)
2. Sentence
3. Custom

### 1. Paragraph mode:


In paragraph mode, you can copy the blocks of text by hovering on any block of text you want. A small preview of the text that you are going to copy will be displayed for convenience. Just clicking on the block of text will get the text copied. 

![copy-code-stackoverflow-copy-text-easily](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iv4gqxos1znnd3emwvyf.gif)

This mode is very useful for copying blocks of code or code snippets on StackOverflow, GitHub, etc.

### 2. Sentence mode:


This is a very unique way to copy sentences from a paragraph. By hovering the mouse on and off the paragraph, you can see different sentences getting selected to copy the text. Whichever sentence you want can be seen in the preview box and just clicking once will get that particular sentence copied to your clipboard. 


![sentence-mode-copy-text-easily](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ub6oa1geu2f29l1qyz8.gif)
This mode is very useful while working with sentences related to writing works. 

### 3. Custom mode:


This is the customized mode to copy any text you want just by selecting. Yes, just selecting a text will copy the text to the clipboard. This is useful in situations when you can want to copy a very specific text when it is not possible with the above previous modes. 

![custom-mode-copy-text-easily](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oyl96bylov4totzqmmqx.gif)

By default, the extension will be active on the active browser tab, and the mouse hovering will result in the preview of text hovered. So to avoid that there's an option to activate this extension on demand by pressing any of `Ctrl`, `Alt`, `Shift` keys. You can select the key at your convenience from the extension keypress options. 


There's even an option to enable or disable the whole extension and the keypress mode. 


Coming to privacy, this extension fully runs on your browser locally and doesn't communicate with the outside world. It is packed in under 15KB of pure JavaScript code without any libraries or frameworks. 


**If you face any problems with this extension you can try the below methods:**



1.  Reload the page whichever is having a problem
2.  Check if the extension is enabled
3.  Check if you have enabled the extension to work only on keypress
4.  Sometimes 'Shift' and 'Alt' keys might have problems, so try to select the 'Ctrl' key if you have problems


And that is all about this simple chrome extension to copy the text in a hassle-free manner.

I'll be sharing interesting tips, tricks and hacks about web development and technology on [Twitter @wahVinci](https://twitter.com/wahVinci) and [Instagram @dev_apt](https://www.instagram.com/dev_apt/), follow if you are interested.

P.S: I'm going to make a tutorial to create extension like this soon, until then support me by following and sharing this article on Twitter.