Roukys / HHauto

GNU General Public License v3.0
45 stars 44 forks source link

AutoSalary [v.5.4.15] - Auto Salary not working when using another page #194

Closed Willyxxx closed 3 years ago

Willyxxx commented 3 years ago

Describe the bug When I'm leaving the page where the script is active and doing Auto Salary, the script stops until I come back on this page.

cossname commented 3 years ago

this is new feature of Google chrome (also few other browsers), its decrease memory and cpu consumption by inactive tabs

Roukys commented 3 years ago

yes in fact it does increase all interval to 1 sec or even 1 minutes in some cases. @Willyxxx you have to open in separate window

cossname commented 3 years ago

@Roukys opening in separate window dont fix this "option", at least for me

Roukys commented 3 years ago

strange does seems to work for me, or chrome has found a way to detect window is not visible I don't know

Willyxxx commented 3 years ago

So what you're telling me is that there is nothing to do and that I can quit the game ?

OldRon1977 commented 3 years ago

If you refer to the new feature that put tabs to sleep, I can only give help for MS Edge. There is the option under the system settings...

Settings and more > Settings > System > Save recourses

If this is enabled the browser put tabs to sleep to save memory. You can completely disable it or define sites to exclude.

Chrome should behave similarly.

I hope that helped :)

NinJaraya commented 3 years ago

This script dealt with the same problem: https://github.com/ccloli/E-Hentai-Downloader/issues/65 Silent Music seems to work.

Roukys commented 3 years ago

thanks @NinJaraya let me try that

cossname commented 3 years ago

i found solution for chrome in this github just disable this flag

chrome://flags

Throttle Javascript timers in background. When enabled, wake ups from DOM Timers are limited to 1 per minute in a page that has been hidden for 5 minutes. For additional details, see https://www.chromestatus.com/feature/4718288976216064. – Mac, Windows, Linux, Chrome OS, Android

if this flag set to default (Enabled), then after 5 min. timer dalay go up so we should just disable it

NinJaraya commented 3 years ago

i found solution for chrome in this github just disable this flag

chrome://flags

Throttle Javascript timers in background. When enabled, wake ups from DOM Timers are limited to 1 per minute in a page that has been hidden for 5 minutes. For additional details, see https://www.chromestatus.com/feature/4718288976216064. – Mac, Windows, Linux, Chrome OS, Android

if this flag set to default (Enabled), then after 5 min. timer dalay go up so we should just disable it

Yes, it has already been noticed here: https://github.com/Roukys/HHauto/issues/178 But there is the issue of battery in notebooks. And the game already has its own music: Nutaku document.querySelector("#hh_bg_music")

<audio id="hh_bg_music" loop="true" volume="0.7">
<source src="https://hh.hh-content.com/pictures/audio/bg_music_2.ogg" type="audio/ogg">
<source src="https://hh.hh-content.com/pictures/audio/bg_music_2.mp3" type="audio/mpeg">
</audio>

Hentai Heroes document.querySelector("#hh_bg_music")

<audio id="hh_bg_music" loop="true" volume="0.7">
<source src="https://hh2.hh-content.com/pictures/audio/bg_music_2.ogg" type="audio/ogg">
<source src="https://hh2.hh-content.com/pictures/audio/bg_music_2.mp3" type="audio/mpeg">
</audio>

Just turn off the volume.

by Google Translate

Roukys commented 3 years ago

if we disable fully you'll have perf issue,

I've implemented the silent volume in 5.4.18 lets try and see @Willyxxx @cossname @OldRon1977 @NinJaraya I'm taking returns ;)

OldRon1977 commented 3 years ago

@Roukys : I see at regulary basis the speaker icon at the tab, but no sound is played. Sofar I would say it works.

Roukys commented 3 years ago

yes that should be the working way, however I don't know if that really fully prevent throttling ..

cossname commented 3 years ago

its working only with tabs, but im use different windows for each account

Roukys commented 3 years ago

and you have the throttling issue ?

OldRon1977 commented 3 years ago

I must say, that even if it does not have any negative effect it bothers me to see the sound icon every few seconds in the tab header. Is there no other way?

Roukys commented 3 years ago

only way found so far, but not sure if it works though

cossname commented 3 years ago

nah, im just disabled js throttling flag because im use edited stable version of script, and update it only when something big changed, new versions going throw test on alt accounts

OldRon1977 commented 3 years ago

So does this mean, we can delete this function from the code?

Roukys commented 3 years ago

disabling it fully in a browser be careful if you use other sites ... advantage of this code is that I can make it only happen in active mode Or at least I think it is possible

dadanda commented 3 years ago

has there been a fix for this script-wise without turning the flag off?

Roukys commented 3 years ago

@dadanda normally yes I've added a blank music, you should see it appear on inactive tab, but for the moment no confirmation has been made that it does do the trick.

OldRon1977 commented 3 years ago

So I would propose to delete that workaround since it appears to not work.

dadanda commented 3 years ago

Hmmm, I mean I do not experience issues with Harem, but I do experience it with Hentai. I just realized the Hentai tab has its tab audio muted. Maybe that's the issue on my end, will confirm with further testing.

Roukys commented 3 years ago

confirmed it is not working as chrome is able t check if a real sound is playing. I've tried different thing but was not able to find a good workaround ( hey that's why I'm not a chrome developper ;)) Last test on my side seems to show that enabling HH sound plus a page refresher every 15min does seems to do the trick

dadanda commented 3 years ago

So, I would say that the sound thing that's occasionally playing that's supposed to be blank is actually happening? Like I would on random, just hear the music of the games in the background when the sounds and music are supposed to be off. But I do not know whether it would actually do the trick on just making AutoSal work without having a tab refresher.

Edit: Nvm, there is music being played, as there is that speaker icon, but it's nothing. So I would say that's the blank. I think it causes the on and off of the sound and music, even in the settings, it's actually off.