tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 64c17b71bdea7fbf5546a404ee5948f8ad8b46cb
parent a07d37898a28232f1426d3893d4ce13a97de92b7
Author: Thomas Wisniewski <twisniewski@mozilla.com>
Date:   Tue, 21 Oct 2025 14:47:22 +0000

Bug 1902454 - add a desktop-only UA override for onvideo.kuaishou.com; r=webcompat-reviewers,ksenia

Differential Revision: https://phabricator.services.mozilla.com/D269313

Diffstat:
Mbrowser/extensions/webcompat/data/interventions.json | 15+++++++++++++++
Atesting/webcompat/interventions/tests/test_1902454_onvideo_kuaishou_com.py | 40++++++++++++++++++++++++++++++++++++++++
2 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/browser/extensions/webcompat/data/interventions.json b/browser/extensions/webcompat/data/interventions.json @@ -3187,6 +3187,21 @@ } ] }, + "1902454": { + "label": "onvideo.kuaishou.com", + "bugs": { + "1902454": { + "issue": "firefox-blocked-completely", + "matches": ["*://onvideo.kuaishou.com/*"] + } + }, + "interventions": [ + { + "platforms": ["desktop"], + "ua_string": ["add_Chrome"] + } + ] + }, "1902459": { "label": "coupangplay.com", "bugs": { diff --git a/testing/webcompat/interventions/tests/test_1902454_onvideo_kuaishou_com.py b/testing/webcompat/interventions/tests/test_1902454_onvideo_kuaishou_com.py @@ -0,0 +1,40 @@ +import pytest + +URL = "https://onvideo.kuaishou.com/v2/hub/home?source=cp" +HERO_CSS = "img[alt=QRcode]" +UNSUPPORTED_TEXT = "建议您升级为谷歌最新版本浏览器" +MOBILE_UNSUPPORTED_TEXT = "暂不支持移动端,请使用电脑进行体验" + + +async def does_warning_appear(client): + await client.navigate(URL, wait="none") + good, bad = client.await_first_element_of( + [ + client.css(HERO_CSS), + client.text(UNSUPPORTED_TEXT), + ], + is_displayed=True, + ) + return bad and not good + + +@pytest.mark.skip_platforms("android") +@pytest.mark.asyncio +@pytest.mark.with_interventions +async def test_enabled(client): + assert not await does_warning_appear(client) + + +@pytest.mark.skip_platforms("android") +@pytest.mark.asyncio +@pytest.mark.without_interventions +async def test_disabled(client): + assert await does_warning_appear(client) + + +@pytest.mark.only_platforms("android") +@pytest.mark.asyncio +@pytest.mark.without_interventions +async def test_mobile_still_unsupported(client): + await client.navigate(URL, wait="none") + assert client.await_text(MOBILE_UNSUPPORTED_TEXT)