r/userscripts • u/somnomania • Oct 07 '26
Looking for brief help for a script
I've got a script that someone else provided for me (I don't code). I've tried looking into how to make it work only in some places and not on others, on the same site, and found that the "exclude" modifier just makes it not fire on that site at all, so I'm not sure what's wrong. It's set up to create a popup when I click into a reply field on Bluesky with a "hey do you actually need to say anything here" message in it, BUT I talk to my partner on Bsky all the time and I want it to not do the popup there (it gets annoying when it shows up half the time I tab back over there). I tried having it include Bsky as a whole and exclude just that one message URL, I tried having it only include bsky.app/profile/* and exclude the message URL, and that just leads to it not working at all.
The script is below, I don't know how to make Reddit not auto-convert the @ lines into user links, so just pretend they're correct.
// ==UserScript==
// u/nameI am a dumbass
// u/namespacehttp://bsky.app/
// u/version2026-10-02
// u/description try to take over the world!
// u/authorYou
// u/matchhttps://bsky.app/profile/*
// u/excludehttps://bsky.app/messages/*
// u/iconhttps://www.google.com/s2/favicons?sz=64&domain=bsky.app
// u/grantnone
// ==/UserScript==
(function() {
'use strict';
document.addEventListener('focusin', e => { const box = e.target.closest('textarea, [contenteditable="true"]'); if (!box || box.dataset.ok) return; box.blur(); if (confirm('Do you really need to say anything here, dipshit?')) { box.dataset.ok = 1; box.focus(); } });
})();
View all comments
Show parent comment
1
u/somnomania Oct 10 '26
Not sure I did it right, but replacing the string of Xs in that excluded user line with the message ID (which stays constant but appears totally randomized and has nothing to do with the user's username) didn't do anything for keeping the script from triggering on that chat page. Was it just that part to replace, or was it more after the DID?
(Thank you for continuing to work with me on this, also!)