Skip to content

Commit 63f7732

Browse files
shakyShanegithub-actions[bot]
authored andcommitted
Release build 4.22.3 [ci release]
1 parent 1b55488 commit 63f7732

File tree

29 files changed

+3133
-800
lines changed

29 files changed

+3133
-800
lines changed

Sources/ContentScopeScripts/dist/contentScopeIsolated.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3654,7 +3654,15 @@
36543654
*/
36553655
bindEvents: (video) => {
36563656
if (video) {
3657+
const before = video.href;
36573658
addTrustedEventListener(video, 'mouseover', () => {
3659+
// don't allow the hover overlay to be shown if the video has changed
3660+
// this can occur with 'shorts'
3661+
if (video.href !== before) {
3662+
if (!VideoThumbnail.isSingleVideoURL(video.href)) {
3663+
return console.log('bailing because the video has changed')
3664+
}
3665+
}
36583666
IconOverlay.moveHoverOverlayToVideoElement(video);
36593667
});
36603668

@@ -4031,7 +4039,7 @@
40314039
* For example, to enable the Duck Player Overlay on YouTube, the following config is used:
40324040
*
40334041
* ```json
4034-
* [[include:integration-test/test-pages/duckplayer/config/overlays.json]]```
4042+
* [[include:integration-test/test-pages/duckplayer/config/overlays-live.json]]```
40354043
*
40364044
*/
40374045

build/android/contentScope.js

Lines changed: 360 additions & 68 deletions
Large diffs are not rendered by default.

build/chrome-mv3/inject.js

Lines changed: 360 additions & 68 deletions
Large diffs are not rendered by default.

build/chrome/inject.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/contentScope.js

Lines changed: 369 additions & 69 deletions
Large diffs are not rendered by default.

build/firefox/inject.js

Lines changed: 360 additions & 68 deletions
Large diffs are not rendered by default.

build/integration/contentScope.js

Lines changed: 369 additions & 69 deletions
Large diffs are not rendered by default.

build/windows/contentScope.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8827,7 +8827,15 @@
88278827
*/
88288828
bindEvents: (video) => {
88298829
if (video) {
8830+
const before = video.href;
88308831
addTrustedEventListener(video, 'mouseover', () => {
8832+
// don't allow the hover overlay to be shown if the video has changed
8833+
// this can occur with 'shorts'
8834+
if (video.href !== before) {
8835+
if (!VideoThumbnail.isSingleVideoURL(video.href)) {
8836+
return console.log('bailing because the video has changed')
8837+
}
8838+
}
88318839
IconOverlay.moveHoverOverlayToVideoElement(video);
88328840
});
88338841

@@ -9204,7 +9212,7 @@
92049212
* For example, to enable the Duck Player Overlay on YouTube, the following config is used:
92059213
*
92069214
* ```json
9207-
* [[include:integration-test/test-pages/duckplayer/config/overlays.json]]```
9215+
* [[include:integration-test/test-pages/duckplayer/config/overlays-live.json]]```
92089216
*
92099217
*/
92109218

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { test } from '@playwright/test'
2+
import { DuckplayerOverlays } from './page-objects/duckplayer-overlays.js'
3+
4+
test.describe('e2e: Duck Player Thumbnail Overlays on YouTube.com', () => {
5+
test('e2e: Overlays never appear on "shorts"', async ({ page }, workerInfo) => {
6+
// @ts-expect-error - TS doesn't know about the "use.e2e" property
7+
workerInfo.skip(!workerInfo.project.use?.e2e)
8+
9+
const overlays = DuckplayerOverlays.create(page, workerInfo)
10+
11+
await overlays.overlaysEnabled({ json: 'overlays-live' })
12+
await overlays.gotoYoutubeHomepage()
13+
14+
// Ensure the hover works normally to prevent false positives
15+
await overlays.hoverAYouTubeThumbnail()
16+
await overlays.isVisible()
17+
18+
// now ensure the hover doesn't work on shorts
19+
await overlays.hoverShort()
20+
await overlays.overlaysDontShow()
21+
})
22+
})

integration-test/playwright/duckplayer.spec.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ test.describe('Duck Player Thumbnail Overlays on YouTube.com', () => {
1515
// Then our overlay shows
1616
await overlays.isVisible()
1717
})
18+
test('Overlays never appear on "shorts"', async ({ page }, workerInfo) => {
19+
const overlays = DuckplayerOverlays.create(page, workerInfo)
20+
await overlays.overlaysEnabled()
21+
await overlays.gotoThumbsPage()
22+
23+
// Ensure the hover works normally to prevent false positives
24+
await overlays.hoverAThumbnail()
25+
await overlays.isVisible()
26+
27+
// now ensure the hover doesn't work on shorts
28+
await overlays.hoverShort()
29+
await overlays.overlaysDontShow()
30+
})
1831
test('Overlays don\'t show on thumbnails when disabled', async ({ page }, workerInfo) => {
1932
const overlays = DuckplayerOverlays.create(page, workerInfo)
2033

0 commit comments

Comments
 (0)