chrome-ai-bridge 1.0.15 → 1.0.17
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.
|
@@ -267,21 +267,27 @@ export const askGeminiWeb = defineTool({
|
|
|
267
267
|
}
|
|
268
268
|
response.appendResponseLine('✅ ログイン確認完了');
|
|
269
269
|
response.appendResponseLine('質問を送信中...');
|
|
270
|
-
// Input text using
|
|
271
|
-
//
|
|
270
|
+
// Input text using innerText + event dispatch for proper Angular state updates
|
|
271
|
+
// This is more reliable than keyboard.type() which can cause sync issues with Angular
|
|
272
272
|
const textboxSelector = '[role="textbox"]';
|
|
273
273
|
const textbox = await page.$(textboxSelector);
|
|
274
274
|
if (!textbox) {
|
|
275
275
|
response.appendResponseLine('❌ 入力欄が見つかりません');
|
|
276
276
|
return;
|
|
277
277
|
}
|
|
278
|
-
// Click to focus
|
|
279
|
-
await textbox.click(
|
|
280
|
-
|
|
281
|
-
//
|
|
282
|
-
await
|
|
278
|
+
// Click to focus
|
|
279
|
+
await textbox.click();
|
|
280
|
+
// Use innerText + input event dispatch for proper Angular state updates
|
|
281
|
+
// This approach is more reliable than keyboard.type() which can cause sync issues
|
|
282
|
+
await textbox.evaluate((el, text) => {
|
|
283
|
+
// Clear and set content
|
|
284
|
+
el.innerText = text;
|
|
285
|
+
// Dispatch input event to notify Angular of the change
|
|
286
|
+
el.dispatchEvent(new Event('input', { bubbles: true }));
|
|
287
|
+
el.dispatchEvent(new Event('change', { bubbles: true }));
|
|
288
|
+
}, sanitizedQuestion);
|
|
283
289
|
// Wait for Angular to process the input and show send button
|
|
284
|
-
await new Promise(resolve => setTimeout(resolve,
|
|
290
|
+
await new Promise(resolve => setTimeout(resolve, 300));
|
|
285
291
|
// 質問送信前に model-response 要素数を記録(ChatGPTと同じカウント方式)
|
|
286
292
|
const initialModelResponseCount = await page.evaluate(() => {
|
|
287
293
|
return document.querySelectorAll('model-response').length;
|
package/package.json
CHANGED