Youtube Better Player

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

< 脚本Youtube Better Player的反馈

评价:好评 - 脚本运行良好

§
发表于:2024-02-04

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

§
发表于:2024-02-04
编辑于:2024-02-04

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))
jeanwl作者
§
发表于:2024-02-04

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.

§
发表于:2024-02-04
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.

jeanwl作者
§
发表于:2024-02-05

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

§
发表于:2024-02-22

forgot to change to good.

发表回复

登录(不可用)以发表回复。

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址