Skip to content

Commit 9a34dcb

Browse files
committed
chore:
1 parent 8aff8ac commit 9a34dcb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

scripts/Auto-Skip-YouTube-Ads/script.user.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// @name:id Lewati Otomatis Iklan YouTube
1212
// @name:hi YouTube विज्ञापन स्वचालित रूप से छोड़ें
1313
// @namespace https://github.com/tientq64/userscripts
14-
// @version 5.3.0
14+
// @version 5.3.1
1515
// @description Automatically skip YouTube ads almost instantly. Remove the ad blocker warning pop-up.
1616
// @description:vi Tự động bỏ qua quảng cáo YouTube gần như ngay lập tức. Loại bỏ cửa sổ bật lên cảnh báo trình chặn quảng cáo.
1717
// @description:zh-CN 几乎立即自动跳过 YouTube 广告。删除广告拦截器警告弹出窗口。
@@ -39,10 +39,10 @@
3939
// ==/UserScript==
4040

4141
/**
42-
* Skip ads. Remove ad blocker warning.
42+
* Skip ads. Remove ad elements.
4343
*/
4444
function skipAd(): void {
45-
hideAdElements()
45+
removeAdElements()
4646

4747
video = null
4848
fineScrubber = document.querySelector<HTMLDivElement>('.ytp-fine-scrubbing')
@@ -279,8 +279,8 @@ function addCss(): void {
279279
'ytmusic-statement-banner-renderer'
280280
].join(',')
281281
const css: string = `
282-
#ytd-player { visibility: visible !important }
283-
${hideCssSelector} { display: none !important }
282+
#ytd-player { visibility: visible !important; }
283+
${hideCssSelector} { display: none !important; }
284284
`
285285
const style: HTMLStyleElement = document.createElement('style')
286286
style.textContent = css
@@ -291,7 +291,7 @@ function addCss(): void {
291291
* Remove ad elements using javascript because these selectors require the use of the CSS
292292
* `:has` selector which is not supported in older browser versions.
293293
*/
294-
function hideAdElements(): void {
294+
function removeAdElements(): void {
295295
const adSelectors: [string, string][] = [
296296
// Ad banner in the upper right corner, above the video playlist.
297297
['#panels', 'ytd-engagement-panel-section-list-renderer[target-id="engagement-panel-ads"]'],

0 commit comments

Comments
 (0)