tor-browser

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

commit b91a9601875b24a2d3b57f8b839e192b1da8d2ea
parent 424a165e85f9ad6589c928772f9fe4093223208b
Author: Thomas Wisniewski <twisniewski@mozilla.com>
Date:   Wed,  8 Oct 2025 13:38:21 +0000

Bug 1899937 - remove our webcompat intervention for plus.nhk.jp; r=denschub,webcompat-reviewers

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

Diffstat:
Mbrowser/extensions/webcompat/data/interventions.json | 19-------------------
Dbrowser/extensions/webcompat/injections/css/bug1899937-plus.nhk.jp-hide-unsupported.css | 13-------------
Dbrowser/extensions/webcompat/injections/js/bug1899937-plus.nhk.jp-request-picture-in-picture.js | 29-----------------------------
Dtesting/webcompat/interventions/tests/test_1899937_plus_nhk_jp.py | 47-----------------------------------------------
4 files changed, 0 insertions(+), 108 deletions(-)

diff --git a/browser/extensions/webcompat/data/interventions.json b/browser/extensions/webcompat/data/interventions.json @@ -2665,25 +2665,6 @@ } ] }, - "1899937": { - "label": "plus.nhk.jp", - "bugs": { - "1899937": { - "issue": "firefox-blocked-completely", - "matches": ["*://plus.nhk.jp/*"] - } - }, - "interventions": [ - { - "platforms": ["all"], - "content_scripts": { - "css": ["bug1899937-plus.nhk.jp-hide-unsupported.css"], - "js": ["bug1899937-plus.nhk.jp-request-picture-in-picture.js"] - }, - "ua_string": ["add_Chrome"] - } - ] - }, "1899945": { "label": "nytimes.com Modern Love Questions", "bugs": { diff --git a/browser/extensions/webcompat/injections/css/bug1899937-plus.nhk.jp-hide-unsupported.css b/browser/extensions/webcompat/injections/css/bug1899937-plus.nhk.jp-hide-unsupported.css @@ -1,13 +0,0 @@ -/* 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/. */ - -/** - * plus.nhk.jp - site displays unsupported warning - * Bug #1899937 - https://bugzilla.mozilla.org/show_bug.cgi?id=1899937 - * WebCompat issue #103463 - https://webcompat.com/issues/103463 - */ - -#for_firefox { - display: none !important; -} diff --git a/browser/extensions/webcompat/injections/js/bug1899937-plus.nhk.jp-request-picture-in-picture.js b/browser/extensions/webcompat/injections/js/bug1899937-plus.nhk.jp-request-picture-in-picture.js @@ -1,29 +0,0 @@ -/* 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/. */ - -"use strict"; - -/** - * Bug 1899937 - Shim requestPictureInPicture for plus.nhk.jp - * WebCompat issue #103463 - https://webcompat.com/issues/103463 - * - * plus.nhk.jp is showing an error when attempting to play videos. - * Shimming requestPictureInPicture to `{}` makes the videos play. - */ - -/* globals exportFunction, cloneInto */ - -console.info( - "PictureInPicture APIs are being shimmed for compatibility reasons. See https://bugzilla.mozilla.org/show_bug.cgi?id=1899937 for details." -); - -const win = window.wrappedJSObject; - -const proto = win.HTMLVideoElement.prototype; -const promise = win.Promise.resolve(); -proto.requestPictureInPicture = exportFunction(() => promise, window); - -win.Document.prototype.pictureInPictureElement = null; -win.PictureInPictureWindow = exportFunction(class {}, window); -win.PictureInPictureEvent = exportFunction(class {}, window); diff --git a/testing/webcompat/interventions/tests/test_1899937_plus_nhk_jp.py b/testing/webcompat/interventions/tests/test_1899937_plus_nhk_jp.py @@ -1,47 +0,0 @@ -import pytest - -URL = "https://plus.nhk.jp/" - -VIDEO_LINK_CSS = "a[href*='plus.nhk.jp/watch']" -VPN_TEXT = "This webpage is not available in your area" -BAD_CSS = "#for_firefox" -GOOD_CSS = "video.hls-player_video, .player--cover--message--button" -UNSUPPORTED_TEXT = "お使いのブラウザ(Firefox)ではご視聴になれません" -UNSUPPORTED2_TEXT = "お使いの環境ではご視聴になれません" - - -async def saw_firefox_warning(client): - await client.navigate(URL, wait="none") - video_link, need_vpn = client.await_first_element_of( - [client.css(VIDEO_LINK_CSS), client.text(VPN_TEXT)], - is_displayed=True, - ) - if need_vpn: - pytest.skip("Region-locked, cannot test. Try using a VPN set to Japan.") - return - found = ( - client.find_css(BAD_CSS, is_displayed=True) - or client.find_text(UNSUPPORTED_TEXT, is_displayed=True) - or client.find_text(UNSUPPORTED2_TEXT, is_displayed=True) - ) - video_link.click() - return found - - -@pytest.mark.asyncio -@pytest.mark.with_interventions -async def test_enabled(client): - assert not await saw_firefox_warning(client) - return client.await_css(GOOD_CSS, timeout=30, is_displayed=True) - assert not client.find_text(UNSUPPORTED_TEXT, is_displayed=True) - assert not client.find_text(UNSUPPORTED2_TEXT, is_displayed=True) - - -@pytest.mark.asyncio -@pytest.mark.without_interventions -async def test_disabled(client): - assert await saw_firefox_warning(client) - bad1, bad2 = client.await_first_element_of( - [client.text(UNSUPPORTED_TEXT), client.text(UNSUPPORTED2_TEXT)], timeout=30 - ) - assert bad1 or bad2