This issue should explain it better: https://github.com/Tudmotu/gnome-shell-extension-clipboard-indicator/issues/248
I found https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/e4ace6e8b0889e2aade0a4588527646f6fe852dc/js/misc/util.js#L376, but I’m not sure how I’m supposed to wire things up. It also seems weird that this wouldn’t be built in.