Skip to content

Commit 1bc2033

Browse files
committed
Bug 1994704 - add a desktop-only JS webcompat intervention for avlguest.justice.nsw.gov.au; r=webcompat-reviewers,ksenia
Differential Revision: https://phabricator.services.mozilla.com/D269478
1 parent 2482353 commit 1bc2033

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

browser/extensions/webcompat/data/interventions.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5756,6 +5756,24 @@
57565756
}
57575757
]
57585758
},
5759+
"1994704": {
5760+
"label": "avlguest.justice.nsw.gov.au",
5761+
"bugs": {
5762+
"1994704": {
5763+
"issue": "page-fails-to-load",
5764+
"matches": ["*://avlguest.justice.nsw.gov.au/*"]
5765+
}
5766+
},
5767+
"interventions": [
5768+
{
5769+
"platforms": ["desktop"],
5770+
"content_scripts": {
5771+
"all_frames": true,
5772+
"js": ["1994704-avlguest.justice.nsw.gov.au-shim-mozRTC-APIs.js"]
5773+
}
5774+
}
5775+
]
5776+
},
57595777
"1995452": {
57605778
"label": "polymarket.com",
57615779
"bugs": {
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
"use strict";
6+
7+
/**
8+
* Bug 1994704 - avlguest.justice.nsw.gov.au test page does not load
9+
*
10+
* The page relies on non-standard mozRTCPeerConnection, which is no longer
11+
* needed. We can just set it to RTCPeerConnection.
12+
*/
13+
14+
/* globals exportFunction */
15+
16+
console.info(
17+
"moz-prefixed JS APIs are being shimmed for compatibility reasons. See https://bugzilla.mozilla.org/show_bug.cgi?id=1994704 for details."
18+
);
19+
20+
window.wrappedJSObject.mozRTCPeerConnection =
21+
window.wrappedJSObject.RTCPeerConnection;
22+
23+
window.wrappedJSObject.mozRTCSessionDescription =
24+
window.wrappedJSObject.RTCSessionDescription;
25+
26+
window.wrappedJSObject.mozRTCIceCandidate =
27+
window.wrappedJSObject.RTCIceCandidate;
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import pytest
2+
3+
URL = "https://avlguest.justice.nsw.gov.au/call/test.link"
4+
IFRAME_CSS = "#widget-frame"
5+
ERROR_MSG = "ReferenceError: mozRTCPeerConnection is not defined"
6+
SUCCESS_CSS = "a.install.btn-success"
7+
INSTALL_APP_CSS = "#installApp"
8+
9+
10+
@pytest.mark.skip_platforms("android")
11+
@pytest.mark.asyncio
12+
@pytest.mark.with_interventions
13+
async def test_enabled(client):
14+
await client.navigate(URL, wait="none")
15+
client.switch_to_frame(client.await_css(IFRAME_CSS))
16+
assert client.await_css(SUCCESS_CSS, is_displayed=True)
17+
18+
19+
@pytest.mark.skip_platforms("android")
20+
@pytest.mark.asyncio
21+
@pytest.mark.without_interventions
22+
async def test_disabled(client):
23+
await client.navigate(URL, await_console_message=ERROR_MSG)
24+
25+
26+
@pytest.mark.only_platforms("android")
27+
@pytest.mark.asyncio
28+
@pytest.mark.with_interventions
29+
async def test_app_installation_requested_on_android(client):
30+
await client.navigate(URL, wait="none")
31+
assert client.await_css(INSTALL_APP_CSS, is_displayed=True)

0 commit comments

Comments
 (0)