@@ -129,18 +129,25 @@ window.OneClickPromptsSelectorAutoDetector = {
129129 ? this . settings . enableStopButtonHeuristics === true
130130 : this . settings . enableContainerHeuristics === true ;
131131
132+ // If heuristics are disabled, stop early and SILENTLY.
133+ if ( ! heuristicsAllowed ) {
134+ logConCgp ( `[SelectorAutoDetector] ${ type } not found. Heuristics disabled; skipping recovery silently.` ) ;
135+ s . recovering = false ;
136+ return null ;
137+ }
138+
132139 // Readable name for the type
133140 const typeName = type === 'editor' ? 'Text input area'
134141 : type === 'sendButton' ? 'send button'
135142 : type === 'stopButton' ? 'stop button'
136143 : 'button container' ;
137144
138- // Unified message logic
139- const statusSuffix = heuristicsAllowed ? "Trying to find it..." : "Auto-detect is off .";
140- const toastType = heuristicsAllowed ? 'info' : 'error ';
145+ // Unified message logic (only reached if heuristicsAllowed is true)
146+ const statusSuffix = "Trying to find it..." ;
147+ const toastType = 'info' ;
141148
142149 if ( window . showToast ) {
143- if ( type === 'container' && heuristicsAllowed ) {
150+ if ( type === 'container' ) {
144151 if ( ! s . containerNotFoundToastEverShown && ! s . containerNotFoundToastDismissed ) {
145152 s . containerNotFoundToastEverShown = true ;
146153 window . showToast ( 'OneClickPrompts: Container where I can insert buttons is not found. Trying to find it automatically, results may disappoint you…' , toastType , {
@@ -155,13 +162,6 @@ window.OneClickPromptsSelectorAutoDetector = {
155162 logConCgp ( `[SelectorAutoDetector] ${ typeName } not found. ${ statusSuffix } ` ) ;
156163 }
157164
158- // If heuristics are disabled, stop here.
159- if ( ! heuristicsAllowed ) {
160- logConCgp ( `[SelectorAutoDetector] Heuristics disabled for ${ type } ; skipping recovery.` ) ;
161- s . recovering = false ;
162- return null ;
163- }
164-
165165 const site = window . InjectionTargetsOnWebsite ?. activeSite || 'Unknown' ;
166166
167167 // Wait a moment for the UI to stabilize (e.g. if the button is just about to appear)
0 commit comments