shujo / consolidate_dropbox

// ==UserScript==
// @name         consolidate_dropbox
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       Josh
// @match        https://www.dropbox.com/*
// @grant        GM_notification
// @license      MIT
// @run-at       document-end
// @require      http://code.jquery.com/jquery-3.3.1.min.js
// ==/UserScript==

(function() {
    'use strict';
     document.body.onkeyup = function(e){
        if(e.ctrlKey && e.keyCode == 13){ //keyboard shortcut: ctrl key + enter
            let data = "ImageName\tURL\n";
            document.querySelectorAll('img.icon.thumbnail-image--loaded.sl-list-icon').forEach(function(item){
	           data = data + item.getAttribute('alt') + "\t" + item.getAttribute('src').replace('size=178x178&size_mode=1','fv_content=true&size_mode=5') + "\n";
            });
            const els = document.createElement('textarea');
            els.value = data;
            document.body.appendChild(els);
            els.select();
            document.execCommand('copy');
            document.body.removeChild(els)
            GM_notification( { title: "Info", text: "Copied Successfully!", timeout: 2000, image: "https://img.icons8.com/color/50/000000/paste.png" } );
        }
    }
})();