Skip to content

Commit f3fe5c7

Browse files
committed
Bug 1995452 - add a desktop-only UA override for polymarket.com; r=webcompat-reviewers,ksenia
Differential Revision: https://phabricator.services.mozilla.com/D269472
1 parent c1eefb7 commit f3fe5c7

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

browser/extensions/webcompat/data/interventions.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5674,5 +5674,22 @@
56745674
}
56755675
}
56765676
]
5677+
},
5678+
"1995452": {
5679+
"label": "polymarket.com",
5680+
"bugs": {
5681+
"1995452": {
5682+
"issue": "extra-scrollbars",
5683+
"matches": ["*://polymarket.com/*"]
5684+
}
5685+
},
5686+
"interventions": [
5687+
{
5688+
"platforms": ["desktop"],
5689+
"content_scripts": {
5690+
"css": ["1995452-polymarket.com-hide-scrollbars.css"]
5691+
}
5692+
}
5693+
]
56775694
}
56785695
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
5+
/**
6+
* polymarket.com - extra scrollbars are visible
7+
* Bug #1995452 - https://bugzilla.mozilla.org/show_bug.cgi?id=1995452
8+
*
9+
* The site uses non-standard webkit-scrollbar CSS to hide scrollbars.
10+
* We can use the web standards compliant method to hide them instead.
11+
*/
12+
* {
13+
scrollbar-width: none;
14+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import pytest
2+
3+
URL = "https://polymarket.com/sports/live"
4+
5+
CONTAINER_CSS = "#scoreboard-scroll-container"
6+
7+
8+
async def is_scrollbar_visible(client):
9+
await client.navigate(URL)
10+
container = client.await_css(CONTAINER_CSS)
11+
return client.execute_script(
12+
"""
13+
const container = arguments[0];
14+
return Math.round(container.getBoundingClientRect().height) != container.clientHeight;
15+
""",
16+
container,
17+
)
18+
19+
20+
@pytest.mark.skip_platforms("android")
21+
@pytest.mark.need_visible_scrollbars
22+
@pytest.mark.asyncio
23+
@pytest.mark.with_interventions
24+
async def test_enabled(client):
25+
assert not await is_scrollbar_visible(client)
26+
27+
28+
@pytest.mark.skip_platforms("android")
29+
@pytest.mark.need_visible_scrollbars
30+
@pytest.mark.asyncio
31+
@pytest.mark.without_interventions
32+
async def test_disabled(client):
33+
assert await is_scrollbar_visible(client)

0 commit comments

Comments
 (0)