Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discovery Queue Reward Detection/Prompt Doesn't Work Anymore #15

Open
PotcFdk opened this issue Dec 17, 2024 · 2 comments
Open

Discovery Queue Reward Detection/Prompt Doesn't Work Anymore #15

PotcFdk opened this issue Dec 17, 2024 · 2 comments
Labels

Comments

@PotcFdk
Copy link
Owner

PotcFdk commented Dec 17, 2024

There is detection code for checking if processing a queue will yield trading cards:

if (HELPERS.isLoggedIn() && (Date.now() - (localStorage.SteamDiscoveryQueueAutoSkipper_lastchecked || 0) > CONSTANTS.HOUR)) {
fetch('https://store.steampowered.com/explore/', {credentials: 'include'}).then(r =>r.text().then(body => {
const doc = new DOMParser().parseFromString(body, 'text/html');
if (HELPERS.getQueueCount(doc) > 0)
ShowConfirmDialog('SteamDiscoveryQueueAutoSkipper',
'You seem to have remaining unlockable trading cards in your discovery queue!\n'
+ 'Do you want to start auto-exploring the queue now?',
'Yes!', 'No, remind me later.').done(function () {
location.href = 'https://store.steampowered.com/explore/startnew';
});
else
console.log('Queue count is 0');
localStorage.SteamDiscoveryQueueAutoSkipper_lastchecked = Date.now();
}));
return HandlerResult.abort;
}

It checks if getQueueCount returns > 0. getQueueCount tries to find a subtext class tag, which doesn't exist anymore:

getQueueCount: (doc) => {
const _subtext = doc.getElementsByClassName('subtext')[0];
if (_subtext) {
const queue_count_subtext = _subtext.innerHTML;
let queue_count = parseInt(queue_count_subtext.replace(/[^0-9.]/g, ''), 10);
if (isNaN(queue_count))
{
const language = doc.documentElement.getAttribute('lang');
switch(language)
{
case 'de':
queue_count = queue_count_subtext.includes(' eine ') ? 1 : 0;
break;
case 'fr':
queue_count = queue_count_subtext.includes(' une ') ? 1 : 0;
break;
case 'it':
queue_count = queue_count_subtext.includes(" un'altra ") ? 1 : 0;
break;
case 'pl':
queue_count = queue_count_subtext.includes(' jedną ') ? 1 : 0;
break;
case 'ru':
case 'uk':
queue_count = queue_count_subtext.includes(' одну ') ? 1 : 0;
break;
default:
queue_count = 0;
}
}
return queue_count;
}
},

This seems to be broken as Valve changed the website probably some time throughout this year.

@PotcFdk PotcFdk added the bug label Dec 17, 2024
@deuxdoom
Copy link

deuxdoom commented Dec 20, 2024

Maybe Valve changed discovery queue system 2024 winter sale.

@sigma67
Copy link

sigma67 commented Dec 27, 2024

discovery queue is now a popup for me

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants