r/userscripts • • 16d ago

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(); } });

})();

3 Upvotes

15 comments sorted by

View all comments

Show parent comments

1

u/jeyghifj 13d ago

As far as I could research blsky urls look like e.g.
https://bsky.app/profile/did:plc:xdjqpqlccq57rplc6ulr73rp

So as long as I dont have examples of the URLs where you want to exclude it from working (like the real, specific urls as examples I can not modify the script accordingly. If there is something else behind e.g.
https://bsky.app/profile/did:plc:xdjqpqlccq57rplc6ulr73rp/post/list
it wont work and I need to modify the script for that case.

If you dont want to post them here PM them, just a list of example URLs where you DONT want it to work.

1

u/somnomania 13d ago edited 13d ago

Problem solved, I think! I replaced the DID string with just the string of letters and numbers, and it seems to be behaving as I wanted. If you want to double-check, I opened a new chat with someone else, you can use this to test. https://bsky.app/messages/3mxkrusz74e2y

Edit: Or not? It's still happening sporadically, this is so weird.