Youtube Better Player

Scroll wheel volume, "Are you there" popup bypass, Volume percent display, Infinite autoplay, Volume save

< Відгуки до Youtube Better Player

Відгук: Добре - скрипт працює добре

§
Опубліковано: 04.02.2024

Could you please fix the script? I don't want to see these error logs.

§
Опубліковано: 04.02.2024
Edited: 04.02.2024

I noticed that

$('ytd-popup-container', unsafeWindow.document).inst

is used in "v0.0.1.20240203200230"

I believe inst will be removed soon. (introduced in early 2023)

The current way is polymerController (introduced in late 2023)

Also, experimental flags might be able to remove inst.

I suggest that (to prevent possible issues)

this.popupContainer.popups_[this.popupName]

change to

((this.popupContainer||0).popups_||0)[this.popupName]

and

$('ytd-popup-container', unsafeWindow.document).inst

to

const insp = o => o ? (o.polymerController || o.inst || o || 0) : (o || 0);
insp($('ytd-popup-container', unsafeWindow.document))
jeanwllАвтор
§
Опубліковано: 04.02.2024

I am sorry about these errors, do you know what specific situation triggers them?

The polymerController way seems like a much better option indeed!

Your suggestions look a bit difficult to read in my opinion; I believe these updates should be good enough?

this.popupContainer = $('ytd-popup-container', unsafeWindow.document).polymerController
const popup = this.popupContainer.popups_?.[this.popupName]

Thank you very much for the thoughtful feedback, I will update this when I hear back from you.

§
Опубліковано: 04.02.2024
const insp = o => o ? (o.polymerController || o.inst || o || 0) : (o || 0);
insp($('ytd-popup-container', unsafeWindow.document))

is to fallback to make sure it works on every browser.

I think

const popup = this.popupContainer.popups_?.[this.popupName]

is acceptable if you are sure that this.popupContainer is not null.

jeanwllАвтор
§
Опубліковано: 05.02.2024

Thank you!
I updated the script.
Let me know if you keep getting these errors.

§
Опубліковано: 22.02.2024

forgot to change to good.

Опублікувати відповідь

Sign in to post a reply.