Skip to content

Commit 2a6d274

Browse files
committed
Bug 1898983 - add a webcompat intervention for elibrary.ferc.gov; r=denschub,webcompat-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D273917
1 parent 4b662a3 commit 2a6d274

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

browser/extensions/webcompat/data/interventions.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5381,6 +5381,23 @@
53815381
}
53825382
]
53835383
},
5384+
"1898983": {
5385+
"label": "elibrary.ferc.gov",
5386+
"bugs": {
5387+
"1898983": {
5388+
"issue": "unsupported-warning",
5389+
"matches": ["*://elibrary.ferc.gov/*"]
5390+
}
5391+
},
5392+
"interventions": [
5393+
{
5394+
"platforms": ["all"],
5395+
"content_scripts": {
5396+
"js": ["bug1898983-elibrary.ferc.gov-window-chrome-shim.js"]
5397+
}
5398+
}
5399+
]
5400+
},
53845401
"1902496": {
53855402
"label": "be.bim.mx",
53865403
"bugs": {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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 1898983 - UA spoof for elibrary.ferc.gov
9+
*
10+
* The site is checking for window.chrome, so let's spoof that.
11+
*/
12+
13+
/* globals exportFunction */
14+
15+
console.info(
16+
"window.chrome has been shimmed for compatibility reasons. https://bugzilla.mozilla.org/show_bug.cgi?id=1898983 for details."
17+
);
18+
19+
window.wrappedJSObject.chrome = new window.wrappedJSObject.Object();
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import pytest
2+
3+
URL = "https://elibrary.ferc.gov/eLibrary/filelist"
4+
5+
UNSUPPORTED_TEXT = "Chrome and Edge"
6+
7+
8+
@pytest.mark.asyncio
9+
@pytest.mark.with_interventions
10+
async def test_enabled(client):
11+
await client.navigate(URL)
12+
await client.stall(3)
13+
assert not client.find_text(UNSUPPORTED_TEXT, is_displayed=True)
14+
15+
16+
@pytest.mark.asyncio
17+
@pytest.mark.without_interventions
18+
async def test_disabled(client):
19+
await client.navigate(URL)
20+
assert client.await_text(UNSUPPORTED_TEXT, is_displayed=True)

0 commit comments

Comments
 (0)