Last active
December 14, 2021 10:55
-
-
Save mold/d30f5650273e43718530 to your computer and use it in GitHub Desktop.
This file contains 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 Drive Number of Files | |
// @namespace dkdscripts | |
// @version 1.0 | |
// @description Shows how many items are displayed currently in drive (updates 1/s) | |
// @author dkd | |
// @downloadURL https://gist.github.com/mold/d30f5650273e43718530/raw/9dbb8d3949945e278563b01d40a277a72506f58f/drive-num-files.user.js | |
// @match https://drive.google.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
var displayText = document.getElementsByClassName("a-pa-ob-yd-aa-J a-pa-ob-yd-aa-J-em a-Ra-Bd a-pa-Ra-Zi"); | |
window.setInterval(function() { | |
var number = document.querySelectorAll("[role=main]:not([style='display: none;']) [data-target=layout]:not([style='display: none;']) .k-ta-P-x").length; | |
for (var i = 0; i < displayText.length; i++) { | |
displayText[i].previousSibling.innerHTML = "Showing " + number + " items" | |
}; | |
}, 1000); | |
})(); |
Hi @Korb, thanks for taking an interest in this! I haven't touched it since I made it in 2015, so the class names in drive have definitely changed, breaking my selectors. I might have a look if I get the time, otherwise feel free to post a fix :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please add a screenshot. After installing via Tampermonkey 4.13.6136 (1 May 2021) in Mozilla Firefox 95.0 (64-bit), I don't see any changes in Google Drive.