Skip to content

Commit f35bd26

Browse files
committed
1 parent 6d279f8 commit f35bd26

File tree

2 files changed

+0
-56
lines changed

2 files changed

+0
-56
lines changed

chromium/extension/lib/chatgpt.js

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -308,34 +308,6 @@ const chatgpt = {
308308

309309
isFullScreen() { return chatgpt.browser.isFullScreen(); },
310310

311-
async isIdle(timeout = null) {
312-
const obsConfig = { childList: true, subtree: true },
313-
msgDivSelector = 'div[data-message-author-role]';
314-
315-
// Create promises
316-
const timeoutPromise = timeout ? new Promise(resolve => setTimeout(() => resolve(false), timeout)) : null;
317-
const isIdlePromise = (async () => {
318-
await new Promise(resolve => { // when on convo page
319-
if (document.querySelector(msgDivSelector)) resolve();
320-
else new MutationObserver((_, obs) => {
321-
if (document.querySelector(msgDivSelector)) { obs.disconnect(); resolve(); }
322-
}).observe(document.body, obsConfig);
323-
});
324-
await new Promise(resolve => { // when reply starts generating
325-
new MutationObserver((_, obs) => {
326-
if (chatgpt.getStopBtn()) { obs.disconnect(); resolve(); }
327-
}).observe(document.body, obsConfig);
328-
});
329-
return new Promise(resolve => { // when reply stops generating
330-
new MutationObserver((_, obs) => {
331-
if (!chatgpt.getStopBtn()) { obs.disconnect(); resolve(true); }
332-
}).observe(document.body, obsConfig);
333-
});
334-
})();
335-
336-
return await (timeoutPromise ? Promise.race([isIdlePromise, timeoutPromise]) : isIdlePromise);
337-
},
338-
339311
notify(msg, position, notifDuration, shadow) {
340312
notifDuration = notifDuration ? +notifDuration : 1.75; // sec duration to maintain notification visibility
341313
const fadeDuration = 0.35, // sec duration of fade-out

firefox/extension/lib/chatgpt.js

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -308,34 +308,6 @@ const chatgpt = {
308308

309309
isFullScreen() { return chatgpt.browser.isFullScreen(); },
310310

311-
async isIdle(timeout = null) {
312-
const obsConfig = { childList: true, subtree: true },
313-
msgDivSelector = 'div[data-message-author-role]';
314-
315-
// Create promises
316-
const timeoutPromise = timeout ? new Promise(resolve => setTimeout(() => resolve(false), timeout)) : null;
317-
const isIdlePromise = (async () => {
318-
await new Promise(resolve => { // when on convo page
319-
if (document.querySelector(msgDivSelector)) resolve();
320-
else new MutationObserver((_, obs) => {
321-
if (document.querySelector(msgDivSelector)) { obs.disconnect(); resolve(); }
322-
}).observe(document.body, obsConfig);
323-
});
324-
await new Promise(resolve => { // when reply starts generating
325-
new MutationObserver((_, obs) => {
326-
if (chatgpt.getStopBtn()) { obs.disconnect(); resolve(); }
327-
}).observe(document.body, obsConfig);
328-
});
329-
return new Promise(resolve => { // when reply stops generating
330-
new MutationObserver((_, obs) => {
331-
if (!chatgpt.getStopBtn()) { obs.disconnect(); resolve(true); }
332-
}).observe(document.body, obsConfig);
333-
});
334-
})();
335-
336-
return await (timeoutPromise ? Promise.race([isIdlePromise, timeoutPromise]) : isIdlePromise);
337-
},
338-
339311
notify(msg, position, notifDuration, shadow) {
340312
notifDuration = notifDuration ? +notifDuration : 1.75; // sec duration to maintain notification visibility
341313
const fadeDuration = 0.35, // sec duration of fade-out

0 commit comments

Comments
 (0)