Skip to content

Commit

Permalink
Changed load/save of asktipDisabled to not rely on unreliable `loca…
Browse files Browse the repository at this point in the history
…lStorage`
  • Loading branch information
adamlui committed Jun 20, 2024
1 parent cf1bb7d commit aab325e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions bravegpt/greasemonkey/bravegpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
// @description:zu Faka izimpendulo ze-AI eceleni kwe-Brave Search. Buza kusuka kunoma yisiphi isiza. Ixhaswe yi-GPT-4o!
// @author KudoAI
// @namespace https://kudoai.com
// @version 2024.6.20.7
// @version 2024.6.20.8
// @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 @@ -783,10 +783,10 @@ setTimeout(async () => {
config.assetHostURL = config.gitHubURL.replace('github.com', 'cdn.jsdelivr.net/gh') + '@c6ccc6f/'
config.userLanguage = chatgpt.getUserLanguage()
config.userLocale = config.userLanguage.includes('-') ? config.userLanguage.split('-')[1].toLowerCase() : ''
loadSetting(['autoGetDisabled', 'autoFocusChatbarDisabled', 'autoScroll', 'fontSize',
loadSetting(['asktipDisabled', 'autoGetDisabled', 'autoFocusChatbarDisabled', 'autoScroll', 'fontSize',
'prefixEnabled', 'proxyAPIenabled', 'replyLanguage', 'rqDisabled', 'scheme',
'streamingDisabled', 'suffixEnabled', 'widerSidebar'])
loadSetting(['asktipDisabled', 'sitesToNotShowAsktip'], 'global')
loadSetting(['sitesToNotShowAsktip'], 'global')
if (!config.replyLanguage) saveSetting('replyLanguage', config.userLanguage) // init reply language if unset
if (!config.fontSize) saveSetting('fontSize', 16) // init reply font size if unset
if (isEdge || getUserscriptManager() != 'Tampermonkey') saveSetting('streamingDisabled', true) // disable streaming if Edge or not TM
Expand Down Expand Up @@ -1011,7 +1011,7 @@ setTimeout(async () => {
+ `(${ msgs.menuLabel_fromAnySite || 'from any site' })`
+ menuState.separator + menuState.word[+!config.asktipDisabled]
menuIDs.push(GM_registerMenuCommand(htaLabel, () => {
saveSetting('asktipDisabled', !config.asktipDisabled, 'global')
saveSetting('asktipDisabled', !config.asktipDisabled)
notify(`${ msgs.menuLabel_highlightToAsk || 'Highlight-to-ask' } ${menuState.word[+!config.asktipDisabled]}`)
refreshMenu()
}))
Expand Down Expand Up @@ -2679,7 +2679,7 @@ setTimeout(async () => {
}
} else { // entry to hide menu always
menuItem.onclick = () => {
saveSetting('asktipDisabled', true, 'global')
saveSetting('asktipDisabled', true)
refreshMenu()
document.getElementById('hide-asktip-menu').style.display = 'none'
document.getElementById('asktip').style.display = 'none'
Expand Down
10 changes: 5 additions & 5 deletions duckduckgpt/greasemonkey/duckduckgpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
// @description:zu Faka izimpendulo ze-AI eceleni kwe-DuckDuckGo. Buza kusuka kunoma yisiphi isiza. Ixhaswe yi-GPT-4o!
// @author KudoAI
// @namespace https://kudoai.com
// @version 2024.6.20.7
// @version 2024.6.20.8
// @license MIT
// @icon https://media.ddgpt.com/images/icons/duckduckgpt/icon48.png?af89302
// @icon64 https://media.ddgpt.com/images/icons/duckduckgpt/icon64.png?af89302
Expand Down Expand Up @@ -783,10 +783,10 @@
config.assetHostURL = config.gitHubURL.replace('github.com', 'cdn.jsdelivr.net/gh') + '@f2c9d00/'
config.userLanguage = chatgpt.getUserLanguage()
config.userLocale = config.userLanguage.includes('-') ? config.userLanguage.split('-')[1].toLowerCase() : ''
loadSetting(['autoget', 'autoFocusChatbarDisabled', 'autoScroll', 'fontSize', 'notFirstRun',
loadSetting(['asktipDisabled', 'autoget', 'autoFocusChatbarDisabled', 'autoScroll', 'fontSize', 'notFirstRun',
'prefixEnabled', 'proxyAPIenabled', 'replyLanguage', 'rqDisabled', 'scheme',
'stickySidebar', 'streamingDisabled', 'suffixEnabled', 'widerSidebar'])
loadSetting(['asktipDisabled', 'sitesToNotShowAsktip'], 'global')
loadSetting(['sitesToNotShowAsktip'], 'global')
if (!config.replyLanguage) saveSetting('replyLanguage', config.userLanguage) // init reply language if unset
if (!config.fontSize) saveSetting('fontSize', 16.4) // init reply font size if unset
if (isEdge || getUserscriptManager() != 'Tampermonkey') saveSetting('streamingDisabled', true) // disable streaming if Edge or not TM
Expand Down Expand Up @@ -1021,7 +1021,7 @@
+ `(${ msgs.menuLabel_fromAnySite || 'from any site' })`
+ menuState.separator + menuState.word[+!config.asktipDisabled]
menuIDs.push(GM_registerMenuCommand(htaLabel, () => {
saveSetting('asktipDisabled', !config.asktipDisabled, 'global')
saveSetting('asktipDisabled', !config.asktipDisabled)
notify(`${ msgs.menuLabel_highlightToAsk || 'Highlight-to-ask' } ${menuState.word[+!config.asktipDisabled]}`)
refreshMenu()
}))
Expand Down Expand Up @@ -2717,7 +2717,7 @@
}
} else { // entry to hide menu always
menuItem.onclick = () => {
saveSetting('asktipDisabled', true, 'global')
saveSetting('asktipDisabled', true)
refreshMenu()
document.getElementById('hide-asktip-menu').style.display = 'none'
document.getElementById('asktip').style.display = 'none'
Expand Down
10 changes: 5 additions & 5 deletions googlegpt/greasemonkey/googlegpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
// @description:zu Yengeza izimpendulo ze-AI ku-Google Search. Buza kuphi noma yikuphi usayithi. Inikwa amandla yi-Google Gemma + GPT-4o!
// @author KudoAI
// @namespace https://kudoai.com
// @version 2024.6.20.8
// @version 2024.6.20.9
// @license MIT
// @icon https://media.googlegpt.io/images/icons/googlegpt/black/icon48.png?8652a6e
// @icon64 https://media.googlegpt.io/images/icons/googlegpt/black/icon64.png?8652a6e
Expand Down Expand Up @@ -982,10 +982,10 @@
config.userLanguage = chatgpt.getUserLanguage()
config.userLocale = window.location.hostname.endsWith('.com') ? 'us'
: window.location.hostname.split('.').pop()
loadSetting(['autoget', 'autoFocusChatbarDisabled', 'autoScroll', 'fontSize', 'notFirstRun',
loadSetting(['asktipDisabled', 'autoget', 'autoFocusChatbarDisabled', 'autoScroll', 'fontSize', 'notFirstRun',
'prefixEnabled', 'proxyAPIenabled', 'replyLanguage', 'rqDisabled', 'scheme',
'stickySidebar', 'streamingDisabled', 'suffixEnabled', 'widerSidebar'])
loadSetting(['asktipDisabled', 'sitesToNotShowAsktip'], 'global')
loadSetting(['sitesToNotShowAsktip'], 'global')
if (!config.replyLanguage) saveSetting('replyLanguage', config.userLanguage) // init reply language if unset
if (!config.fontSize) saveSetting('fontSize', isMobile ? 14 : 16.55) // init reply font size if unset
if (isEdge || getUserscriptManager() != 'Tampermonkey') saveSetting('streamingDisabled', true) // disable streaming if Edge or not TM
Expand Down Expand Up @@ -1217,7 +1217,7 @@
+ `(${ msgs.menuLabel_fromAnySite || 'from any site' })`
+ menuState.separator + menuState.word[+!config.asktipDisabled]
menuIDs.push(GM_registerMenuCommand(htaLabel, () => {
saveSetting('asktipDisabled', !config.asktipDisabled, 'global')
saveSetting('asktipDisabled', !config.asktipDisabled)
notify(`${ msgs.menuLabel_highlightToAsk || 'Highlight-to-ask' } ${menuState.word[+!config.asktipDisabled]}`)
refreshMenu()
}))
Expand Down Expand Up @@ -2935,7 +2935,7 @@
}
} else { // entry to hide menu always
menuItem.onclick = () => {
saveSetting('asktipDisabled', true, 'global')
saveSetting('asktipDisabled', true)
refreshMenu()
document.getElementById('hide-asktip-menu').style.display = 'none'
document.getElementById('asktip').style.display = 'none'
Expand Down

0 comments on commit aab325e

Please sign in to comment.