Created
March 19, 2020 18:24
-
-
Save q0rban/2842d6d9450b8c4c74844a15dfaa0d8c to your computer and use it in GitHub Desktop.
PipeDrive Fluid App Userscript
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
// PipeDrive Fluid App Activity Dock Badge. | |
// Authored by @q0rban | |
// 1. Set Patterns to *pipedrive.com*. | |
// 2. Paste this script. | |
// 3. Refresh your Fluid App. | |
// 4. If you still don't see badges, you might have to edit ~/Library/com.apple.ncprefs.plist | |
// and set flags for the app to "41,951,254". Then log out and log back in. | |
window.fluid.dockBadge = ''; | |
// Set the dock badge after one second. | |
setTimeout(updateDockBadge, 1000); | |
// Try again after 3 seconds if the first failed. | |
setTimeout(updateDockBadge, 3000); | |
// And then every 5 seconds. | |
setInterval(updateDockBadge, 5000); | |
function updateDockBadge() { | |
var newBadge = ''; | |
var activities = document.querySelector('.key-activities .count'); | |
if (activities.innerHTML) { | |
newBadge = Number(activities.innerHTML); | |
console.log('activity count: %s', newBadge); | |
} | |
window.fluid.dockBadge = newBadge; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment