https://github.com/kelpycode/jacket
A jQuery Javascript extension for PasteJacking
https://github.com/kelpycode/jacket
Last synced: 17 days ago
JSON representation
A jQuery Javascript extension for PasteJacking
- Host: GitHub
- URL: https://github.com/kelpycode/jacket
- Owner: KelpyCode
- Created: 2016-07-17T19:13:43.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-17T19:52:52.000Z (almost 10 years ago)
- Last Synced: 2025-01-18T09:52:35.877Z (over 1 year ago)
- Language: JavaScript
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Jacket
A jQuery Javascript extension for PasteJacking
##What is 'PasteJacking'?
PasteJacking is modifying the Clipboard by changing it to something else.
This could be potentially be used for malicious use.
Just imagine: You read a web tutorial and just want to copy paste.
```
echo Hello this is totally safe to use! :)
```
And you straight up copy it in the CMD / Terminal and suddenly..
```
echo "I am dr evil! >:D" & rm -rf *
(\n) <-- Newline so the CLI gets executed
```
Obviously thats not good but thats not in my hands.
**If you copy paste terminal stuff directly from a website please make sure you are pasting the right thing**
##Requirement
[jQuery](http://jquery.com) is required in order to use Jacket.
Jacket has to be loaded AFTER jQuery.
```html
```
##Example of use
Refer to **/examples** or read below:
###Binding copy
We have this textbox:
```html
```
And we want that the user copies **'Some stuff - Read more at x'**.
This is possible by the following JavaScript:
```javascript
$("#jackthis").jacket($(this).val() + " - Read more at x");
```
Now when the users copies text from the texbox, he will copy it including the " - Read more at x"
##Unbinding copy
Simply use
```javascript
$("#jackthis").jacket()
```
##Documentation
[Please refer to the Wiki](https://github.com/XaoticLabs/Jacket/wiki)
##License
[MIT License](http://choosealicense.com/licenses/mit/)