Skip to content

Commit

Permalink
Added support for custom GPTs
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed Jun 25, 2024
1 parent e9f5880 commit 2a964a1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion chrome/extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@
if (!fromMsg) notify(chrome.i18n.getMessage('menuLabel_infinityMode') + ': ON')
fromMsg = false
if (chatgpt.browser.isMobile() && chatgpt.sidebar.isOn()) chatgpt.sidebar.hide()
try { chatgpt.startNewChat() } catch (err) { return }
if (!new URL(document.location).pathname.startsWith('/g/')) // not on GPT page
try { chatgpt.startNewChat() } catch (err) { return } // start new chat
settings.load('replyLanguage', 'replyTopic', 'replyInterval').then(() => setTimeout(() => {
chatgpt.send('Generate a single random question'
+ ( config.replyLanguage ? ( ' in ' + config.replyLanguage ) : '' )
Expand Down
3 changes: 2 additions & 1 deletion edge/extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@
if (!fromMsg) notify(chrome.i18n.getMessage('menuLabel_infinityMode') + ': ON')
fromMsg = false
if (chatgpt.browser.isMobile() && chatgpt.sidebar.isOn()) chatgpt.sidebar.hide()
try { chatgpt.startNewChat() } catch (err) { return }
if (!new URL(document.location).pathname.startsWith('/g/')) // not on GPT page
try { chatgpt.startNewChat() } catch (err) { return } // start new chat
settings.load('replyLanguage', 'replyTopic', 'replyInterval').then(() => setTimeout(() => {
chatgpt.send('Generate a single random question'
+ ( config.replyLanguage ? ( ' in ' + config.replyLanguage ) : '' )
Expand Down
5 changes: 3 additions & 2 deletions greasemonkey/chatgpt-infinity.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
// @description:zh-TW 從無所不知的 ChatGPT 生成無窮無盡的答案 (用任何語言!)
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2024.6.24
// @version 2024.6.25
// @license MIT
// @match *://chatgpt.com/*
// @match *://chat.openai.com/*
Expand Down Expand Up @@ -688,7 +688,8 @@
activate: async () => {
notify(( msgs.menuLabel_infinityMode || 'Infinity Mode' ) + ': ON')
if (chatgpt.browser.isMobile() && chatgpt.sidebar.isOn()) chatgpt.sidebar.hide()
try { chatgpt.startNewChat() } catch (err) { return }
if (!new URL(document.location).pathname.startsWith('/g/')) // not on GPT page
try { chatgpt.startNewChat() } catch (err) { return } // start new chat
setTimeout(() => {
chatgpt.send('Generate a single random question'
+ ( config.replyLanguage ? ( ' in ' + config.replyLanguage ) : '' )
Expand Down
3 changes: 2 additions & 1 deletion opera/extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@
if (!fromMsg) notify(chrome.i18n.getMessage('menuLabel_infinityMode') + ': ON')
fromMsg = false
if (chatgpt.browser.isMobile() && chatgpt.sidebar.isOn()) chatgpt.sidebar.hide()
try { chatgpt.startNewChat() } catch (err) { return }
if (!new URL(document.location).pathname.startsWith('/g/')) // not on GPT page
try { chatgpt.startNewChat() } catch (err) { return } // start new chat
settings.load('replyLanguage', 'replyTopic', 'replyInterval').then(() => setTimeout(() => {
chatgpt.send('Generate a single random question'
+ ( config.replyLanguage ? ( ' in ' + config.replyLanguage ) : '' )
Expand Down

0 comments on commit 2a964a1

Please sign in to comment.