Skip to content

Instantly share code, notes, and snippets.

@kandros
Created January 19, 2015 12:31
Show Gist options
  • Save kandros/dcae43e4cdd20f1c793d to your computer and use it in GitHub Desktop.
Save kandros/dcae43e4cdd20f1c793d to your computer and use it in GitHub Desktop.
Bookmarklet dropbox folder files size
javascript:(function() { var kb = Object.values(BrowseFile._file_index).reduce(function(kb, file) { return kb + file.bytes/1000; }, 0); var units = ['kb', 'mb', 'gb', 'tb'], unit = units.shift(), size = kb; for (var i=0; i<3; i++) { if (size < 1000) { break; } size /= 1000; unit = units.shift(); } alert('Folder size: ' + (Math.round(size*1000)/1000) + ' ' + unit);})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment