drone-ui-alerts
drone-ui-alerts copied to clipboard
drone.io ui gets updating favicon and desktop notifications
drone-ui-alerts
This script adds updating favicon and desktop notifications to drone.io ui.
What does this do
It makes the drone-ui favicon refelect the status of the pipeline on the current page instead of the status of all pipelines running.
It also sends a notification when the pipeline status changes.
Why
It is annoying to keep checking the drone page for updates instead of looking at the favicon or seeing a notification. There is an open issue in the drone-ui repo about this.
Installation
This script was designed to be used with Violentmonkey but should also work with Greasemonkey or Tampermonkey.
To use this script just install one of the extension above, click create new script, and paste this script.
You should update the @match
section at the top of the script with the url of your drone installation.
Bookmarklets
You can make a bookmarklet to run as needed instead of installing an extension. I recommend creating the bookmarklet using this tool. Notifications won't work with the bookmarklet since they depend on the GM_notification api.
Next Steps
- Use getValue for user preferences s
- Use a more object oriented approach
- Evaluate using the MutationObserver instead of polling
Learnings
- You cannot use CSS to change SVGs when they are encoded in
img
tags. Otherwise I would use CSS to change the SVG color. - You don't need to base64 encode data URI, but you may need to encode them with encodeURIComponent.