Skip to content

Conversation

Shashank4516
Copy link

@Shashank4516 Shashank4516 commented Jul 4, 2025

This pull request introduces a new feature to js&css/web-accessible/init.js that enhances user experience by adding functionality to handle tab visibility changes.

Feature addition:

  • js&css/web-accessible/init.js: Added an event listener for the visibilitychange event to invoke ImprovedTube.playerAutopauseWhenSwitchingTabs when switching tabs, ensuring the player automatically pauses if the function is defined.

@Shashank4516
Copy link
Author

Shashank4516 commented Jul 4, 2025

@wbalbo pls review it sir

@wbalbo
Copy link
Contributor

wbalbo commented Jul 4, 2025

@wbalbo pls review it sir

Where is the rest? The toggle should be in messages.json and is not in your code, how can we enable/disable the feature?

You agree to use a toggle in the previous PR and ignore it in this code.

Again, try to not use AI for everything and understand the code, look at the PR that I mentioned before and you will understand how to implement these things.

Also, @ImprovedTube, I am not sure if the init.js is the best place to put this code. Should not be a specific function to be called once the toggle is on, like the others?

Thanks.

@Shashank4516
Copy link
Author

@wbalbo sir Just to clarify I didn’t create a new toggle.
I’m using the existing setting: autopauseWhenSwitchingTabs that’s already in messages.json/en

@wbalbo pls review it sir

Where is the rest? The toggle should be in messages.json and is not in your code, how can we enable/disable the feature?

You agree to use a toggle in the previous PR and ignore it in this code.

Again, try to not use AI for everything and understand the code, look at the PR that I mentioned before and you will understand how to implement these things.

Also, @ImprovedTube, I am not sure if the init.js is the best place to put this code. Should not be a specific function to be called once the toggle is on, like the others?

Thanks.
Screenshot 2025-07-04 192130

@wbalbo sir Just to clarify I didn’t create a new toggle.
I’m using the existing setting: autopauseWhenSwitchingTabs that’s already in messages.json/locales/en

@wbalbo
Copy link
Contributor

wbalbo commented Jul 4, 2025

@wbalbo sir Just to clarify I didn’t create a new toggle. I’m using the existing setting: autopauseWhenSwitchingTabs that’s already in messages.json/en

@wbalbo pls review it sir

Where is the rest? The toggle should be in messages.json and is not in your code, how can we enable/disable the feature?
You agree to use a toggle in the previous PR and ignore it in this code.
Again, try to not use AI for everything and understand the code, look at the PR that I mentioned before and you will understand how to implement these things.
Also, @ImprovedTube, I am not sure if the init.js is the best place to put this code. Should not be a specific function to be called once the toggle is on, like the others?
Thanks.
Screenshot 2025-07-04 192130

@wbalbo sir Just to clarify I didn’t create a new toggle. I’m using the existing setting: autopauseWhenSwitchingTabs that’s already in messages.json/locales/en

Ah okay, sorry then, my bad. I didn't know that we had this option. Some options are still new to me.

Good, then, makes sense to me. But I can't merge anything.

@Shashank4516
Copy link
Author

@ImprovedTube pls review it

@ImprovedTube ImprovedTube added Art untested please test. (also applies to proactively merged pull requests.) and removed Art labels Jul 5, 2025
@ImprovedTube
Copy link
Member

hi @Shashank4516 looks good! can be merged if it helps

Also, @ImprovedTube, I am not sure if the init.js is the best place to put this code. Should not be a specific function to be called once the toggle is on, like the others?

just started that for some (mentioned here again in italic #3023 (comment) )

@ImprovedTube ImprovedTube requested review from ImprovedTube and removed request for ImprovedTube July 5, 2025 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

untested please test. (also applies to proactively merged pull requests.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants