@tomflow/chatloop-extension 0.4.50 → 0.4.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -78,10 +78,16 @@ async function nativeMentionAndSend(id,appId,prompt){
|
|
|
78
78
|
'[data-testid*="app-item"]','[data-testid*="mention-item"]'];
|
|
79
79
|
for(let i=0;i<55;i++){
|
|
80
80
|
if(location.pathname!=='/')return fail('ENTRY_PAGE_CHANGED');
|
|
81
|
-
const
|
|
82
|
-
.filter(visible)
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
const all=[...document.querySelectorAll(selectors.join(','))]
|
|
82
|
+
.filter(visible);
|
|
83
|
+
// ChatGPT may render the exact App option with empty innerText.
|
|
84
|
+
// Validate the native App ID first, not its incidental display text.
|
|
85
|
+
const matching=all.filter(e=>e.getAttribute('data-plugin-impression-id')===appId);
|
|
86
|
+
if(matching.length>1)return fail('ENTRY_NATIVE_APP_OPTION_AMBIGUOUS');
|
|
87
|
+
if(matching.length===1&&!matching[0].disabled){
|
|
88
|
+
choice=matching[0];break;
|
|
89
|
+
}
|
|
90
|
+
const nodes=all.filter(e=>(e.innerText||'').includes('Chat Loop'));
|
|
85
91
|
const exact=nodes.filter(e=>{
|
|
86
92
|
const t=(e.innerText||'').trim();
|
|
87
93
|
return t==='Chat Loop'||t.startsWith('Chat Loop\n');
|
package/extension/manifest.json
CHANGED