Add handling for free account detection in checkGPTModel function. see #408
This commit is contained in:
parent
a6d5de564a
commit
4485b7fe2c
1 changed files with 10 additions and 0 deletions
|
|
@ -342,6 +342,16 @@ function checkGPTModel(model) {
|
|||
// const element = document.querySelector('div#radix-\\\\:ri2\\\\: > div > span.text-token-text-secondary');
|
||||
const elements = document.querySelectorAll('[id*=radix] span')
|
||||
|
||||
// If there are no elements, we are using a free account, so go on immediately
|
||||
if (elements.length === 0) {
|
||||
doLog("checkGPTModel no model found in DOM, we are using free account.");
|
||||
clearInterval(intervalId);
|
||||
clearTimeout(intervalId2);
|
||||
resolve('free');
|
||||
return;
|
||||
}
|
||||
|
||||
// Loop through the elements to find the one with the specified text content
|
||||
for(let element of elements){
|
||||
// Check if the element exists and its content is '4' or '4o'
|
||||
doLog("checkGPTModel model found in DOM: " + element.textContent);
|
||||
|
|
|
|||
Loading…
Reference in a new issue