-
Notifications
You must be signed in to change notification settings - Fork 38
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
Using resources ? #4
Comments
Auto-clicking the small notification that appears in the left bottom corner doesn't stop the actual pausing from happening. It was among the first things I tried and I guess YouTube is smarter than that and can figure out if the clicking was legit. Furthermore, if the YouTube tab is inactive, the popup never gets spawned, because the DOM elements aren't updated. The video just gets paused and only if you navigate to the tab the actual popup spawns. This was a problem I didn't know about in the first versions. So to conclude, the script is called every 500ms to un-pause the video as fast as possible in a reasonable manner. A way I thought of but didn't have the time yet to explore, that might work, is maybe if you can bind an event to the elements of interest and just detect their change... that would eliminate the need for the 500ms interval. |
on the video page there is a json object with some (maybe) interesting variables : "youthere_innertube_actions":true and on polymer js there are some functions : |
Sorry for the late reply, busy week. I've also tried debugging the polymer js to see what makes it tick but didn't get far. And even if I find what triggers the check, since it looks to be some internal js, I have no idea how to stop it from executing or even if it's possible at all without blocking js altogether. |
i found this code which modify a function that return the time since activity. I don't know why it still use setInterval if it modifies the function : https://greasyfork.org/en/scripts/35157-remove-youtube-activity-check/code maybe it can be improved ? edit: even better ! Strangely, it seems like it is already true for me right now ... ? edit: maybe it's with value false as with true i got the video pause |
youtube is using the variable window._lact to store the last time an activity was recorded |
I was never able to make it work by changing this variable or any other variable for that matter. Also the script you attached didn't work for me. If you have any success, feel free to submit a pull request and I'll examine it. |
hello
it seems the script is called every 500ms that check if there is a popup.
That seems to be resource intensive.
Could it be in a better way to use less resource ?
Also, i saw a popup that says it will "soon" pause the video if i don't confirm. So, instead of detecting that the video is paused by youtube, could it detect that it will soon pause the video if we don't click, and click on that instead, so no need to unpause the video, just click on that, and also maybe run the script much less than 2 times a second (i guess you do that to quickly unpause the video and not cause interruption ?)
The text was updated successfully, but these errors were encountered: