Skip to content

Commit

Permalink
Moved XHR init before 1st use for readability ↞ [auto-sync from `adam…
Browse files Browse the repository at this point in the history
…lui/chatgpt-apps`]
  • Loading branch information
adamlui authored and kudo-sync-bot committed Sep 14, 2024
1 parent 39727e8 commit c6b8672
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions greasemonkey/bravegpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
// @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2024.9.13.8
// @version 2024.9.14
// @license MIT
// @icon https://media.bravegpt.com/images/icons/bravegpt/icon48.png?0a9e287
// @icon64 https://media.bravegpt.com/images/icons/bravegpt/icon64.png?0a9e287
Expand Down Expand Up @@ -320,11 +320,6 @@
if (!streamingSupported.browser || !streamingSupported.userscriptManager) saveSetting('streamingDisabled', true) // disable Streaming in unspported env
log.debug(`Success! config = ${log.prettifyObj(config)}`)

// Init XHR fetcher
log.debug('Initializing XHR fetcher...')
const xhr = getUserscriptManager() == 'OrangeMonkey' ? GM_xmlhttpRequest : GM.xmlHttpRequest
log.debug(`Success! xhr = ${ getUserscriptManager() == 'OrangeMonkey' ? 'GM_xmlhttpRequest' : 'GM.xmlHttpRequest' }`)

// Init API props
log.debug('Initializing API properties...')
const apis = {
Expand Down Expand Up @@ -378,6 +373,11 @@
inputEvents[action] = ( window.PointerEvent ? 'pointer' : browser.isMobile ? 'touch' : 'mouse' ) + action)
log.debug(`Success! inputEvents = ${log.prettifyObj(inputEvents)}`)

// Init XHR fetcher
log.debug('Initializing XHR fetcher...')
const xhr = getUserscriptManager() == 'OrangeMonkey' ? GM_xmlhttpRequest : GM.xmlHttpRequest
log.debug(`Success! xhr = ${ getUserscriptManager() == 'OrangeMonkey' ? 'GM_xmlhttpRequest' : 'GM.xmlHttpRequest' }`)

// Init localized MESSAGES
log.debug('Initializing localized messages...')
let msgs = {}
Expand Down

0 comments on commit c6b8672

Please sign in to comment.