tor-browser

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

commit f3fe5c71de921e9693b0fb3ae1426e0e7ed6ef29
parent c1eefb7447bebccfc633ef111390c6e2aa88d4e8
Author: Thomas Wisniewski <twisniewski@mozilla.com>
Date:   Wed, 22 Oct 2025 14:47:04 +0000

Bug 1995452 - add a desktop-only UA override for polymarket.com; r=webcompat-reviewers,ksenia

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

Diffstat:
Mbrowser/extensions/webcompat/data/interventions.json | 17+++++++++++++++++
Abrowser/extensions/webcompat/injections/css/1995452-polymarket.com-hide-scrollbars.css | 14++++++++++++++
Atesting/webcompat/interventions/tests/test_1995452_polymarket_com.py | 33+++++++++++++++++++++++++++++++++
3 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/browser/extensions/webcompat/data/interventions.json b/browser/extensions/webcompat/data/interventions.json @@ -5674,5 +5674,22 @@ } } ] + }, + "1995452": { + "label": "polymarket.com", + "bugs": { + "1995452": { + "issue": "extra-scrollbars", + "matches": ["*://polymarket.com/*"] + } + }, + "interventions": [ + { + "platforms": ["desktop"], + "content_scripts": { + "css": ["1995452-polymarket.com-hide-scrollbars.css"] + } + } + ] } } diff --git a/browser/extensions/webcompat/injections/css/1995452-polymarket.com-hide-scrollbars.css b/browser/extensions/webcompat/injections/css/1995452-polymarket.com-hide-scrollbars.css @@ -0,0 +1,14 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/** + * polymarket.com - extra scrollbars are visible + * Bug #1995452 - https://bugzilla.mozilla.org/show_bug.cgi?id=1995452 + * + * The site uses non-standard webkit-scrollbar CSS to hide scrollbars. + * We can use the web standards compliant method to hide them instead. + */ +* { + scrollbar-width: none; +} diff --git a/testing/webcompat/interventions/tests/test_1995452_polymarket_com.py b/testing/webcompat/interventions/tests/test_1995452_polymarket_com.py @@ -0,0 +1,33 @@ +import pytest + +URL = "https://polymarket.com/sports/live" + +CONTAINER_CSS = "#scoreboard-scroll-container" + + +async def is_scrollbar_visible(client): + await client.navigate(URL) + container = client.await_css(CONTAINER_CSS) + return client.execute_script( + """ + const container = arguments[0]; + return Math.round(container.getBoundingClientRect().height) != container.clientHeight; + """, + container, + ) + + +@pytest.mark.skip_platforms("android") +@pytest.mark.need_visible_scrollbars +@pytest.mark.asyncio +@pytest.mark.with_interventions +async def test_enabled(client): + assert not await is_scrollbar_visible(client) + + +@pytest.mark.skip_platforms("android") +@pytest.mark.need_visible_scrollbars +@pytest.mark.asyncio +@pytest.mark.without_interventions +async def test_disabled(client): + assert await is_scrollbar_visible(client)