This script adds updating favicon and desktop notifications to drone.io ui.
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.
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.
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.
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.
- Use getValue for user preferences s
- Use a more object oriented approach
- Evaluate using the MutationObserver instead of polling
- 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.