mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 1921410 - add a UA override for beta.maps.apple.com to bypass block of desktop Linux; r=denschub,webcompat-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D225160
This commit is contained in:
parent
75e2b24293
commit
dd2fde61a8
@ -1422,6 +1422,24 @@ const AVAILABLE_UA_OVERRIDES = [
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
/*
|
||||
* Bug 1921410 - UA override for beta.maps.apple.com
|
||||
* Webcompat issue #140205 - https://webcompat.com/issues/140205
|
||||
*
|
||||
* Apple Maps beta artifically blocks Linux.
|
||||
*/
|
||||
id: "bug1921410",
|
||||
platform: "linux",
|
||||
domain: "beta.maps.apple.com",
|
||||
bug: "1921410",
|
||||
config: {
|
||||
matches: ["*://beta.maps.apple.com/*"],
|
||||
uaTransformer: originalUA => {
|
||||
return UAHelpers.getWindowsUA(originalUA);
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
module.exports = AVAILABLE_UA_OVERRIDES;
|
||||
|
@ -144,13 +144,14 @@ class UAOverrides {
|
||||
|
||||
async registerUAOverrides() {
|
||||
const platformMatches = ["all"];
|
||||
let platformInfo = await browser.runtime.getPlatformInfo();
|
||||
platformMatches.push(platformInfo.os == "android" ? "android" : "desktop");
|
||||
const { os } = await browser.runtime.getPlatformInfo();
|
||||
platformMatches.push(os);
|
||||
platformMatches.push(os == "android" ? "android" : "desktop");
|
||||
|
||||
for (const override of this._availableOverrides) {
|
||||
if (platformMatches.includes(override.platform)) {
|
||||
override.availableOnPlatform = true;
|
||||
override.currentPlatform = platformInfo.os;
|
||||
override.currentPlatform = os;
|
||||
|
||||
// If there is a specific about:config preference governing
|
||||
// this override, monitor its state.
|
||||
|
@ -1422,6 +1422,24 @@ const AVAILABLE_UA_OVERRIDES = [
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
/*
|
||||
* Bug 1921410 - UA override for beta.maps.apple.com
|
||||
* Webcompat issue #140205 - https://webcompat.com/issues/140205
|
||||
*
|
||||
* Apple Maps beta artifically blocks Linux.
|
||||
*/
|
||||
id: "bug1921410",
|
||||
platform: "linux",
|
||||
domain: "beta.maps.apple.com",
|
||||
bug: "1921410",
|
||||
config: {
|
||||
matches: ["*://beta.maps.apple.com/*"],
|
||||
uaTransformer: originalUA => {
|
||||
return UAHelpers.getWindowsUA(originalUA);
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
module.exports = AVAILABLE_UA_OVERRIDES;
|
||||
|
@ -144,13 +144,14 @@ class UAOverrides {
|
||||
|
||||
async registerUAOverrides() {
|
||||
const platformMatches = ["all"];
|
||||
let platformInfo = await browser.runtime.getPlatformInfo();
|
||||
platformMatches.push(platformInfo.os == "android" ? "android" : "desktop");
|
||||
const { os } = await browser.runtime.getPlatformInfo();
|
||||
platformMatches.push(os);
|
||||
platformMatches.push(os == "android" ? "android" : "desktop");
|
||||
|
||||
for (const override of this._availableOverrides) {
|
||||
if (platformMatches.includes(override.platform)) {
|
||||
override.availableOnPlatform = true;
|
||||
override.currentPlatform = platformInfo.os;
|
||||
override.currentPlatform = os;
|
||||
|
||||
// If there is a specific about:config preference governing
|
||||
// this override, monitor its state.
|
||||
|
@ -0,0 +1,23 @@
|
||||
import pytest
|
||||
|
||||
URL = "https://beta.maps.apple.com/"
|
||||
BLOCKED_CSS = "#unsupported"
|
||||
NOT_BLOCKED_CSS = "#shell-container"
|
||||
|
||||
|
||||
@pytest.mark.only_platforms("linux")
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.with_interventions
|
||||
async def test_enabled(client):
|
||||
await client.navigate(URL)
|
||||
assert client.await_css(NOT_BLOCKED_CSS)
|
||||
assert not client.find_css(BLOCKED_CSS)
|
||||
|
||||
|
||||
@pytest.mark.only_platforms("linux")
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.without_interventions
|
||||
async def test_disabled(client):
|
||||
await client.navigate(URL)
|
||||
assert client.await_css(BLOCKED_CSS)
|
||||
assert not client.find_css(NOT_BLOCKED_CSS)
|
Loading…
Reference in New Issue
Block a user