聊天章鱼

🐙 让章鱼为您发送多条信息

当前为 2023-04-20 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name chat-octopus
  3. // @namespace https://github.com/mefengl
  4. // @version 0.2.13
  5. // @description 🐙 let octopus send multiple messages for you
  6. // @icon https://www.google.com/s2/favicons?sz=64&domain=openai.com
  7. // @author mefengl
  8. // @match https://chat.openai.com/*
  9. // @match https://bard.google.com/*
  10. // @match https://www.bing.com/search?q=Bing+AI*
  11. // @require https://cdn.staticfile.org/jquery/3.6.1/jquery.min.js
  12. // @grant GM_openInTab
  13. // @grant GM_registerMenuCommand
  14. // @grant GM_unregisterMenuCommand
  15. // @grant GM_getValue
  16. // @grant GM_setValue
  17. // @grant GM_addValueChangeListener
  18. // @license MIT
  19.  
  20. // @name:en Chat Octopus
  21. // @description:en 🐙 let octopus send multiple messages for you
  22. // @name:zh-CN 聊天章鱼
  23. // @description:zh-CN 🐙 让章鱼为您发送多条信息
  24. // @name:es Chat Pulpo
  25. // @description:es 🐙 deja que el pulpo envíe múltiples mensajes por ti
  26. // @name:hi चैट ऑक्टोपस
  27. // @description:hi 🐙 आपके लिए कई संदेश भेजने के लिए ऑक्टोपस की अनुमति दें
  28. // @name:ar أخطبوط الدردشة
  29. // @description:ar 🐙 دع الأخطبوط يرسل رسائل متعددة نيابة عنك
  30. // @name:pt Chat Polvo
  31. // @description:pt 🐙 deixe o polvo enviar várias mensagens para você
  32. // @name:ru Чат-осьминог
  33. // @description:ru 🐙 позвольте осьминогу отправлять несколько сообщений за вас
  34. // @name:ja チャットオクトパス
  35. // @description:ja 🐙 タコがあなたに代わって複数のメッセージを送る
  36. // @name:de Chat-Oktopus
  37. // @description:de 🐙 Lassen Sie den Oktopus mehrere Nachrichten für Sie senden
  38. // @name:fr Chat Poulpe
  39. // @description:fr 🐙 laissez la pieuvre envoyer plusieurs messages pour vous
  40. // ==/UserScript==
  41. "use strict";
  42. (() => {
  43. var __async = (__this, __arguments, generator) => {
  44. return new Promise((resolve, reject) => {
  45. var fulfilled = (value) => {
  46. try {
  47. step(generator.next(value));
  48. } catch (e) {
  49. reject(e);
  50. }
  51. };
  52. var rejected = (value) => {
  53. try {
  54. step(generator.throw(value));
  55. } catch (e) {
  56. reject(e);
  57. }
  58. };
  59. var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
  60. step((generator = generator.apply(__this, __arguments)).next());
  61. });
  62. };
  63.  
  64. // ../../packages/chatkit/dist/chunk-QXAXOUZS.mjs
  65. var __defProp = Object.defineProperty;
  66. var __export = (target, all) => {
  67. for (var name in all)
  68. __defProp(target, name, { get: all[name], enumerable: true });
  69. };
  70.  
  71. // ../../packages/chatkit/dist/chunk-RKGOWDBQ.mjs
  72. var chatgpt_exports = {};
  73. __export(chatgpt_exports, {
  74. getConversation: () => getConversation,
  75. getLastResponse: () => getLastResponse,
  76. getLastResponseElement: () => getLastResponseElement,
  77. getModelSelectButton: () => getModelSelectButton,
  78. getRegenerateButton: () => getRegenerateButton,
  79. getStopGeneratingButton: () => getStopGeneratingButton,
  80. getSubmitButton: () => getSubmitButton,
  81. getTextarea: () => getTextarea,
  82. getTextareaValue: () => getTextareaValue,
  83. isConversationStarted: () => isConversationStarted,
  84. isGenerating: () => isGenerating,
  85. isHorizontalConversation: () => isHorizontalConversation,
  86. onSend: () => onSend,
  87. regenerate: () => regenerate,
  88. send: () => send,
  89. setHorizontalConversation: () => setHorizontalConversation,
  90. setPromptListener: () => setPromptListener,
  91. setPureConversation: () => setPureConversation,
  92. setTextarea: () => setTextarea,
  93. waitForIdle: () => waitForIdle
  94. });
  95. function getTextarea() {
  96. const form = document.querySelector("form");
  97. if (!form)
  98. return;
  99. const textareas = form.querySelectorAll("textarea");
  100. const result = textareas[0];
  101. return result;
  102. }
  103. function getSubmitButton() {
  104. const textarea = getTextarea();
  105. if (!textarea)
  106. return;
  107. return textarea.nextElementSibling;
  108. }
  109. function getRegenerateButton() {
  110. const form = document.querySelector("form");
  111. if (!form)
  112. return;
  113. const buttons = form.querySelectorAll("button");
  114. const result = Array.from(buttons).find((button) => {
  115. var _a;
  116. return (_a = button.textContent) == null ? void 0 : _a.trim().toLowerCase().includes("regenerate");
  117. });
  118. return result;
  119. }
  120. function getStopGeneratingButton() {
  121. const form = document.querySelector("form");
  122. if (!form)
  123. return;
  124. const buttons = form.querySelectorAll("button");
  125. const result = Array.from(buttons).find((button) => {
  126. var _a;
  127. return (_a = button.textContent) == null ? void 0 : _a.trim().toLowerCase().includes("stop generating");
  128. });
  129. return result;
  130. }
  131. function getLastResponseElement() {
  132. const responseElements = document.querySelectorAll(".group.w-full");
  133. return responseElements[responseElements.length - 1];
  134. }
  135. function getLastResponse() {
  136. const lastResponseElement = getLastResponseElement();
  137. if (!lastResponseElement)
  138. return;
  139. const lastResponse = lastResponseElement.textContent;
  140. return lastResponse;
  141. }
  142. function getTextareaValue() {
  143. var _a;
  144. return ((_a = getTextarea()) == null ? void 0 : _a.value) || "";
  145. }
  146. function setTextarea(message) {
  147. const textarea = getTextarea();
  148. if (!textarea)
  149. return;
  150. textarea.value = message;
  151. textarea.dispatchEvent(new Event("input"));
  152. }
  153. function send(message) {
  154. setTextarea(message);
  155. const textarea = getTextarea();
  156. if (!textarea)
  157. return;
  158. textarea.dispatchEvent(new KeyboardEvent("keydown", { key: "Enter", bubbles: true }));
  159. }
  160. function regenerate() {
  161. const regenerateButton = getRegenerateButton();
  162. if (!regenerateButton)
  163. return;
  164. regenerateButton.click();
  165. }
  166. function onSend(callback) {
  167. const textarea = getTextarea();
  168. if (!textarea)
  169. return;
  170. textarea.addEventListener("keydown", function(event) {
  171. if (event.key === "Enter" && !event.shiftKey) {
  172. callback();
  173. }
  174. });
  175. const sendButton = getSubmitButton();
  176. if (!sendButton)
  177. return;
  178. sendButton.addEventListener("mousedown", callback);
  179. }
  180. function isGenerating() {
  181. var _a, _b;
  182. return ((_b = (_a = getSubmitButton()) == null ? void 0 : _a.firstElementChild) == null ? void 0 : _b.childElementCount) === 3;
  183. }
  184. function waitForIdle() {
  185. return new Promise((resolve) => {
  186. const interval = setInterval(() => {
  187. if (!isGenerating()) {
  188. clearInterval(interval);
  189. resolve();
  190. }
  191. }, 1e3);
  192. });
  193. }
  194. function setPromptListener(key = "prompt_texts") {
  195. let last_trigger_time = +/* @__PURE__ */ new Date();
  196. if (location.href.includes("chat.openai")) {
  197. GM_addValueChangeListener(key, (name, old_value, new_value) => __async(this, null, function* () {
  198. if (+/* @__PURE__ */ new Date() - last_trigger_time < 500) {
  199. return;
  200. }
  201. last_trigger_time = +/* @__PURE__ */ new Date();
  202. setTimeout(() => __async(this, null, function* () {
  203. const prompt_texts = new_value;
  204. if (prompt_texts.length > 0) {
  205. let firstTime = true;
  206. while (prompt_texts.length > 0) {
  207. if (!firstTime) {
  208. yield new Promise((resolve) => setTimeout(resolve, 2e3));
  209. }
  210. if (!firstTime && isGenerating()) {
  211. continue;
  212. }
  213. firstTime = false;
  214. const prompt_text = prompt_texts.shift() || "";
  215. send(prompt_text);
  216. }
  217. }
  218. }), 0);
  219. GM_setValue(key, []);
  220. }));
  221. }
  222. }
  223. function getConversation() {
  224. var _a, _b;
  225. return (_b = (_a = document.querySelector('div[class^="react-scroll-to-bottom"]')) == null ? void 0 : _a.firstChild) == null ? void 0 : _b.firstChild;
  226. }
  227. function getModelSelectButton() {
  228. const conversation = getConversation();
  229. if (!conversation)
  230. return;
  231. return Array.from(conversation.querySelectorAll("button")).find((button) => {
  232. var _a;
  233. return (_a = button.textContent) == null ? void 0 : _a.trim().toLowerCase().includes("model");
  234. });
  235. }
  236. function isConversationStarted() {
  237. return !getModelSelectButton();
  238. }
  239. function setPureConversation() {
  240. const conversation = getConversation();
  241. if (!conversation)
  242. return;
  243. const firstChild = conversation.firstChild;
  244. if (!firstChild)
  245. return;
  246. const newDiv = document.createElement("div");
  247. conversation.insertBefore(newDiv, firstChild.nextSibling);
  248. }
  249. function isHorizontalConversation() {
  250. const conversation = getConversation();
  251. if (!conversation)
  252. return true;
  253. if (!isConversationStarted())
  254. return true;
  255. return conversation.classList.contains("grid");
  256. }
  257. function setHorizontalConversation() {
  258. if (isHorizontalConversation())
  259. return;
  260. setPureConversation();
  261. const conversation = getConversation();
  262. if (!conversation)
  263. return;
  264. conversation.classList.remove("flex", "flex-col", "items-center");
  265. conversation.classList.add("grid", "grid-cols-2", "place-items-center");
  266. }
  267.  
  268. // ../../packages/chatkit/dist/chunk-SIBHE5N3.mjs
  269. var bing_exports = {};
  270. __export(bing_exports, {
  271. getActionBar: () => getActionBar,
  272. getChatTurns: () => getChatTurns,
  273. getConversation: () => getConversation2,
  274. getLastChatTurn: () => getLastChatTurn,
  275. getLastResponse: () => getLastResponse2,
  276. getLastResponseText: () => getLastResponseText,
  277. getNewChatButton: () => getNewChatButton,
  278. getRegenerateButton: () => getRegenerateButton2,
  279. getStopGeneratingButton: () => getStopGeneratingButton2,
  280. getSubmitButton: () => getSubmitButton2,
  281. getSuggestionBar: () => getSuggestionBar,
  282. getSuggestionBarButtons: () => getSuggestionBarButtons,
  283. getTextarea: () => getTextarea2,
  284. onSend: () => onSend2,
  285. send: () => send2
  286. });
  287. function getActionBar() {
  288. var _a, _b, _c;
  289. return ((_c = (_b = (_a = document.querySelector("cib-serp")) == null ? void 0 : _a.shadowRoot) == null ? void 0 : _b.querySelector("cib-action-bar")) == null ? void 0 : _c.shadowRoot) || null;
  290. }
  291. function getSubmitButton2() {
  292. const actionBar = getActionBar();
  293. if (!actionBar) {
  294. return null;
  295. }
  296. return actionBar.querySelector('button[aria-label="Submit"]');
  297. }
  298. function getTextarea2() {
  299. const actionBar = getActionBar();
  300. if (!actionBar) {
  301. return null;
  302. }
  303. return actionBar.querySelector("textarea");
  304. }
  305. function getStopGeneratingButton2() {
  306. var _a, _b;
  307. const actionBar = getActionBar();
  308. if (!actionBar) {
  309. return null;
  310. }
  311. const stopGeneratingButton = (_b = (_a = actionBar.querySelector("cib-typing-indicator")) == null ? void 0 : _a.shadowRoot) == null ? void 0 : _b.querySelector('button[aria-label="Stop Responding"]');
  312. if (!stopGeneratingButton) {
  313. return null;
  314. }
  315. if (stopGeneratingButton.disabled) {
  316. return null;
  317. }
  318. return stopGeneratingButton;
  319. }
  320. function getNewChatButton() {
  321. const actionBar = getActionBar();
  322. if (!actionBar) {
  323. return null;
  324. }
  325. return actionBar.querySelector('button[aria-label="New topic"]');
  326. }
  327. function getConversation2() {
  328. var _a, _b, _c;
  329. return ((_c = (_b = (_a = document.querySelector("cib-serp")) == null ? void 0 : _a.shadowRoot) == null ? void 0 : _b.querySelector("cib-conversation")) == null ? void 0 : _c.shadowRoot) || null;
  330. }
  331. function getChatTurns() {
  332. const conversation = getConversation2();
  333. if (!conversation) {
  334. return null;
  335. }
  336. return Array.from(conversation.querySelectorAll("cib-chat-turn")).map((t) => t.shadowRoot);
  337. }
  338. function getSuggestionBar() {
  339. var _a;
  340. const conversation = getConversation2();
  341. if (!conversation) {
  342. return null;
  343. }
  344. return ((_a = conversation.querySelector("cib-suggestion-bar")) == null ? void 0 : _a.shadowRoot) || null;
  345. }
  346. function getSuggestionBarButtons() {
  347. const suggestionBar = getSuggestionBar();
  348. if (!suggestionBar) {
  349. return [];
  350. }
  351. const suggestionItems = Array.from(suggestionBar.querySelectorAll("cib-suggestion-item"));
  352. return suggestionItems.map((i) => {
  353. var _a;
  354. return (_a = i.shadowRoot) == null ? void 0 : _a.querySelector("button");
  355. });
  356. }
  357. function getRegenerateButton2() {
  358. const suggestionBarButtons = getSuggestionBarButtons();
  359. if (!suggestionBarButtons.length) {
  360. return null;
  361. }
  362. return suggestionBarButtons[0];
  363. }
  364. function getLastChatTurn() {
  365. const chatTurns = getChatTurns();
  366. if (!chatTurns) {
  367. return null;
  368. }
  369. return chatTurns[chatTurns.length - 1];
  370. }
  371. function getLastResponse2() {
  372. var _a;
  373. const lastChatTurn = getLastChatTurn();
  374. if (!lastChatTurn) {
  375. return null;
  376. }
  377. return ((_a = lastChatTurn.querySelectorAll("cib-message-group")[1]) == null ? void 0 : _a.shadowRoot) || null;
  378. }
  379. function getLastResponseText() {
  380. var _a;
  381. const lastResponse = getLastResponse2();
  382. if (!lastResponse) {
  383. return null;
  384. }
  385. const message = Array.from(lastResponse.querySelectorAll("cib-message")).map((m) => m.shadowRoot).find((m) => m == null ? void 0 : m.querySelector("cib-shared"));
  386. return ((_a = message == null ? void 0 : message.textContent) == null ? void 0 : _a.trim()) || null;
  387. }
  388. function send2(text) {
  389. const textarea = getTextarea2();
  390. if (!textarea) {
  391. return;
  392. }
  393. textarea.value = text;
  394. textarea.dispatchEvent(new Event("input"));
  395. const submitButton = getSubmitButton2();
  396. if (!submitButton) {
  397. return;
  398. }
  399. submitButton.click();
  400. }
  401. function onSend2(callback) {
  402. const textarea = getTextarea2();
  403. if (!textarea)
  404. return;
  405. textarea.addEventListener("keydown", function(event) {
  406. if (event.key === "Enter" && !event.shiftKey) {
  407. callback();
  408. }
  409. });
  410. const sendButton = getSubmitButton2();
  411. if (!sendButton)
  412. return;
  413. sendButton.addEventListener("mousedown", callback);
  414. }
  415.  
  416. // ../../packages/chatkit/dist/chunk-ABU253YF.mjs
  417. var bard_exports = {};
  418. __export(bard_exports, {
  419. getInputArea: () => getInputArea,
  420. getLastPrompt: () => getLastPrompt,
  421. getLatestPromptText: () => getLatestPromptText,
  422. getRegenerateButton: () => getRegenerateButton3,
  423. getSubmitButton: () => getSubmitButton3,
  424. getTextarea: () => getTextarea3,
  425. onSend: () => onSend3,
  426. send: () => send3
  427. });
  428. function getSubmitButton3() {
  429. return document.querySelector('button[aria-label="Send message"]');
  430. }
  431. function getInputArea() {
  432. return document.querySelector(".input-area");
  433. }
  434. function getTextarea3() {
  435. const inputArea = getInputArea();
  436. return inputArea ? inputArea.querySelector("textarea") : null;
  437. }
  438. function getRegenerateButton3() {
  439. return document.querySelector('button[aria-label="Retry"]');
  440. }
  441. function getLastPrompt() {
  442. const promptElements = document.querySelectorAll(".query-text");
  443. const lastPrompt = promptElements[promptElements.length - 1];
  444. return lastPrompt;
  445. }
  446. function getLatestPromptText() {
  447. const lastPrompt = getLastPrompt();
  448. if (!lastPrompt)
  449. return "";
  450. const lastPromptText = lastPrompt.textContent;
  451. return lastPromptText || "";
  452. }
  453. function send3(text) {
  454. const textarea = getTextarea3();
  455. if (!textarea)
  456. return;
  457. textarea.value = text;
  458. textarea.dispatchEvent(new Event("input"));
  459. const submitButton = getSubmitButton3();
  460. if (!submitButton)
  461. return;
  462. submitButton.click();
  463. }
  464. function onSend3(callback) {
  465. const textarea = getTextarea3();
  466. if (!textarea)
  467. return;
  468. textarea.addEventListener("keydown", function(event) {
  469. if (event.key === "Enter" && !event.shiftKey) {
  470. callback();
  471. }
  472. });
  473. const sendButton = getSubmitButton3();
  474. if (!sendButton)
  475. return;
  476. sendButton.addEventListener("mousedown", callback);
  477. }
  478.  
  479. // src/index.js
  480. (function() {
  481. "use strict";
  482. const default_menu_all = {};
  483. const menu_all = GM_getValue("menu_all", default_menu_all);
  484. const menus = [
  485. { checker: () => location.href.includes("chat.openai"), name: "openai", value: true },
  486. { checker: () => location.href.includes("bard.google"), name: "bard", value: true },
  487. { checker: () => location.href.includes("Bing+AI"), name: "bing", value: true }
  488. ];
  489. menus.forEach((menu) => {
  490. $(() => menu.checker() && GM_setValue(menu.name, true));
  491. if (GM_getValue(menu.name) == true) {
  492. default_menu_all[menu.name] = menu.value;
  493. }
  494. });
  495. for (let name in default_menu_all) {
  496. if (!(name in menu_all)) {
  497. menu_all[name] = default_menu_all[name];
  498. }
  499. }
  500. const menu_id = GM_getValue("menu_id", {});
  501. function registerMenuCommand(name, value) {
  502. const menuText = ` ${name}\uFF1A${value ? "\u2705" : "\u274C"}`;
  503. const commandCallback = () => {
  504. menu_all[name] = !menu_all[name];
  505. GM_setValue("menu_all", menu_all);
  506. update_menu();
  507. location.reload();
  508. };
  509. return GM_registerMenuCommand(menuText, commandCallback);
  510. }
  511. function update_menu() {
  512. for (let name in menu_all) {
  513. const value = menu_all[name];
  514. if (menu_id[name]) {
  515. GM_unregisterMenuCommand(menu_id[name]);
  516. }
  517. menu_id[name] = registerMenuCommand(name, value);
  518. }
  519. GM_setValue("menu_id", menu_id);
  520. }
  521. update_menu();
  522. let chatgpt_last_prompt = "";
  523. $(() => {
  524. if (menu_all.openai && location.href.includes("chat.openai")) {
  525. chatgpt_exports.onSend(() => {
  526. const textarea = chatgpt_exports.getTextarea();
  527. if (!textarea) {
  528. return;
  529. }
  530. const prompt = textarea.value;
  531. chatgpt_last_prompt = prompt;
  532. GM_setValue("bard_prompt_texts", [prompt]);
  533. GM_setValue("bing_prompt_texts", [prompt]);
  534. });
  535. }
  536. });
  537. let last_trigger_time = +/* @__PURE__ */ new Date();
  538. $(() => {
  539. if (location.href.includes("chat.openai")) {
  540. GM_addValueChangeListener("chatgpt_prompt_texts", (name, old_value, new_value) => {
  541. if (+/* @__PURE__ */ new Date() - last_trigger_time < 500) {
  542. return;
  543. }
  544. last_trigger_time = +/* @__PURE__ */ new Date();
  545. setTimeout(() => __async(this, null, function* () {
  546. const prompt_texts = new_value;
  547. if (prompt_texts.length > 0) {
  548. let firstTime = true;
  549. while (prompt_texts.length > 0) {
  550. if (!firstTime) {
  551. yield new Promise((resolve) => setTimeout(resolve, 2e3));
  552. }
  553. if (!firstTime && chatgpt_exports.getRegenerateButton() == void 0) {
  554. continue;
  555. }
  556. firstTime = false;
  557. const prompt_text = prompt_texts.shift();
  558. if (prompt_text === chatgpt_last_prompt) {
  559. continue;
  560. }
  561. chatgpt_exports.send(prompt_text);
  562. }
  563. }
  564. }), 0);
  565. GM_setValue("chatgpt_prompt_texts", []);
  566. });
  567. }
  568. });
  569. let bard_last_prompt = "";
  570. $(() => __async(this, null, function* () {
  571. if (menu_all.bard && location.href.includes("bard.google")) {
  572. while (!bard_exports.getSubmitButton()) {
  573. yield new Promise((resolve) => setTimeout(resolve, 500));
  574. }
  575. bard_exports.onSend(() => {
  576. const textarea = bard_exports.getTextarea();
  577. if (!textarea) {
  578. return;
  579. }
  580. let prompt = textarea.value;
  581. if (!prompt) {
  582. prompt = bard_exports.getLatestPromptText();
  583. }
  584. bard_last_prompt = prompt;
  585. GM_setValue("chatgpt_prompt_texts", [prompt]);
  586. GM_setValue("bing_prompt_texts", [prompt]);
  587. });
  588. }
  589. }));
  590. let lastTriggerTime = +/* @__PURE__ */ new Date();
  591. if (location.href.includes("bard.google")) {
  592. GM_addValueChangeListener("bard_prompt_texts", (name, old_value, new_value) => {
  593. if (+/* @__PURE__ */ new Date() - lastTriggerTime < 500) {
  594. return;
  595. }
  596. lastTriggerTime = +/* @__PURE__ */ new Date();
  597. setTimeout(() => __async(this, null, function* () {
  598. const promptTexts = new_value;
  599. if (promptTexts.length > 0) {
  600. let firstTime = true;
  601. while (promptTexts.length > 0) {
  602. if (!firstTime) {
  603. yield new Promise((resolve) => setTimeout(resolve, 2e3));
  604. }
  605. if (!firstTime && bard_exports.getRegenerateButton() == void 0) {
  606. continue;
  607. }
  608. firstTime = false;
  609. const promptText = promptTexts.shift();
  610. if (promptText === bard_last_prompt) {
  611. continue;
  612. }
  613. bard_exports.send(promptText);
  614. }
  615. }
  616. }), 0);
  617. GM_setValue("bard_prompt_texts", []);
  618. });
  619. }
  620. let bing_last_prompt = "";
  621. $(() => __async(this, null, function* () {
  622. if (menu_all.bing && location.href.includes("Bing+AI")) {
  623. while (!bing_exports.getSubmitButton()) {
  624. yield new Promise((resolve) => setTimeout(resolve, 500));
  625. }
  626. bing_exports.onSend(() => {
  627. const textarea = bing_exports.getTextarea();
  628. if (!textarea) {
  629. return;
  630. }
  631. const prompt = textarea.value;
  632. bing_last_prompt = prompt;
  633. GM_setValue("chatgpt_prompt_texts", [prompt]);
  634. GM_setValue("bard_prompt_texts", [prompt]);
  635. });
  636. }
  637. }));
  638. let last_trigger_time_bing = +/* @__PURE__ */ new Date();
  639. if (location.href.includes("Bing+AI")) {
  640. GM_addValueChangeListener("bing_prompt_texts", (name, old_value, new_value) => {
  641. if (+/* @__PURE__ */ new Date() - last_trigger_time_bing < 500) {
  642. return;
  643. }
  644. last_trigger_time_bing = +/* @__PURE__ */ new Date();
  645. setTimeout(() => __async(this, null, function* () {
  646. const prompt_texts = new_value;
  647. if (prompt_texts.length > 0) {
  648. let firstTime = true;
  649. while (prompt_texts.length > 0) {
  650. if (!firstTime) {
  651. yield new Promise((resolve) => setTimeout(resolve, 2e3));
  652. }
  653. if (!firstTime && bing_exports.getStopGeneratingButton() != void 0) {
  654. continue;
  655. }
  656. firstTime = false;
  657. const prompt_text = prompt_texts.shift();
  658. if (prompt_text === bing_last_prompt) {
  659. continue;
  660. }
  661. bing_exports.send(prompt_text);
  662. }
  663. }
  664. }), 0);
  665. GM_setValue("bing_prompt_texts", []);
  666. });
  667. }
  668. })();
  669. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址