mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-11 04:07:44 +02:00
[eric] browser: broaden compose-trigger vocabulary (create/new-thread/start-a-thread variants)
The reveal opener regex only matched 'create a post', missing bare 'Create' and 'New thread' / 'Start a thread' buttons that real compose surfaces use. Adds those; safe by construction (a broadened trigger can never produce a false success, a fill against a real composer is still required, so a trigger that opens a signup/join upsell instead of a composer yields found:false). Validated CDP-direct: LinkedIn-post and YouTube-comment still flip (no regression), and Threads (which gates posting behind a 'Join Threads' upsell for this session) correctly does NOT false-fill
This commit is contained in:
@@ -402,7 +402,7 @@ async function handleFindComposer(wv: BrowserWebview, params: Record<string, any
|
||||
const SUBMIT = /\\b(send|post|reply|comment|tweet|publish|share|message)\\b/i;
|
||||
const SEARCH = /search|find\\b|filter|query|lookup|explore|jump to/i;
|
||||
// Reversible compose openers: reveal a writing surface, never commit one.
|
||||
const OPENER = /\\b(start a post|create( a)? post|new post|add a comment|write a comment|leave a comment|post a comment|write a review|create a review|new message|new chat|send a message|compose|reply|comment|tweet|write)\\b/i;
|
||||
const OPENER = /\\b(start a post|start a thread|create( a)?( new)? (post|thread)|new post|new thread|add a comment|write a comment|leave a comment|post a comment|write a review|create a review|new message|new chat|send a message|compose|reply|comment|tweet|create|write)\\b/i;
|
||||
// Never clickable by reveal, even if the label also looks like an opener.
|
||||
const HARDBLOCK = /\\b(send|submit|pay|buy|purchase|checkout|order|delete|remove|unfollow|unsubscribe|log ?out|sign ?out|report|block|confirm|deactivate|save)\\b/i;
|
||||
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
||||
|
||||
Reference in New Issue
Block a user