Created
June 28, 2018 09:40
-
-
Save zbicin/c215184c24f63368d4c27e2ffa9f6a9c to your computer and use it in GitHub Desktop.
A userscript that adds copyJson method to the window object.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name copyJson | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description Stringifies given argument and copies it to the clipboard. | |
| // @author @zbicin | |
| // @match *://localhost*/* | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| window.copyJson = (arg) => { | |
| let json = JSON.stringify(arg, null, 2); | |
| copy(json); | |
| console.log('📋 Copied!') | |
| }; | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment