Skip to content

Instantly share code, notes, and snippets.

@q0rban
Created March 19, 2020 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save q0rban/2842d6d9450b8c4c74844a15dfaa0d8c to your computer and use it in GitHub Desktop.
Save q0rban/2842d6d9450b8c4c74844a15dfaa0d8c to your computer and use it in GitHub Desktop.
PipeDrive Fluid App Userscript
// 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