tor-browser

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

commit abd89d56a76e1ef5996c2a1d197e387e2ed9106c
parent f12aec981d3b1070d868de4d7a7b396b6139a2ec
Author: Thomas Wisniewski <twisniewski@mozilla.com>
Date:   Wed, 26 Nov 2025 23:06:58 +0000

Bug 1928954 - remove our obsolete interventions for publix.com and eyebuydirect.ca (not needed as of ESR 140); r=ksenia,webcompat-reviewers

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

Diffstat:
Mbrowser/extensions/webcompat/data/interventions.json | 36------------------------------------
Dbrowser/extensions/webcompat/injections/css/bug1901000-eyebuydirect.ca-fix-paypal-button.css | 17-----------------
Dbrowser/extensions/webcompat/injections/js/bug1928954-publix.com-prevent-nav-on-javascript-url-click.js | 20--------------------
Dtesting/webcompat/interventions/tests/test_1901000_eyebuydirect_ca.py | 142-------------------------------------------------------------------------------
Dtesting/webcompat/interventions/tests/test_1928954_publix_com.py | 21---------------------
5 files changed, 0 insertions(+), 236 deletions(-)

diff --git a/browser/extensions/webcompat/data/interventions.json b/browser/extensions/webcompat/data/interventions.json @@ -2695,24 +2695,6 @@ } ] }, - "1901000": { - "label": "eyebuydirect.ca", - "bugs": { - "1901000": { - "issue": "broken-interactive-elements", - "matches": ["*://*.eyebuydirect.ca/*"] - } - }, - "interventions": [ - { - "platforms": ["desktop"], - "max_version": 134, - "content_scripts": { - "css": ["bug1901000-eyebuydirect.ca-fix-paypal-button.css"] - } - } - ] - }, "1901780": { "label": "vanbreda-health.be", "bugs": { @@ -3970,24 +3952,6 @@ } ] }, - "1928954": { - "label": "publix.com", - "bugs": { - "1928954": { - "issue": "broken-interactive-elements", - "matches": ["*://*.publix.com/*"] - } - }, - "interventions": [ - { - "platforms": ["all"], - "max_version": 139, - "content_scripts": { - "js": ["bug1928954-publix.com-prevent-nav-on-javascript-url-click.js"] - } - } - ] - }, "1930440": { "label": "online.singaporepools.com", "bugs": { diff --git a/browser/extensions/webcompat/injections/css/bug1901000-eyebuydirect.ca-fix-paypal-button.css b/browser/extensions/webcompat/injections/css/bug1901000-eyebuydirect.ca-fix-paypal-button.css @@ -1,17 +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/. */ - -/** - * eyebuydirect.ca - PayPal button is unclickable - * Bug #1901000 - https://bugzilla.mozilla.org/show_bug.cgi?id=1901000 - * WebCompat issue #137777 - https://github.com/webcompat/web-bugs/issues/137777 - * - * The site uses Zoid components for the PayPal button, which gives opacity:0 to - * its containing element, which makes it unclickable in Firefox. We should be able - * to simply remove that opacity:0 for now. - */ - -[id^="zoid-paypal-buttons-"] { - opacity: unset !important; -} diff --git a/browser/extensions/webcompat/injections/js/bug1928954-publix.com-prevent-nav-on-javascript-url-click.js b/browser/extensions/webcompat/injections/js/bug1928954-publix.com-prevent-nav-on-javascript-url-click.js @@ -1,20 +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"; - -console.info( - "Links with javascript: URLs are being ammended to prevent breakage. See https://bugzilla.mozilla.org/show_bug.cgi?id=1928954 for details." -); - -document.documentElement.addEventListener( - "click", - e => { - const jslink = e.target?.closest("a[href^='javascript:']"); - if (jslink && !jslink.href.endsWith(";undefined")) { - jslink.href = `${jslink.href};undefined`; - } - }, - true -); diff --git a/testing/webcompat/interventions/tests/test_1901000_eyebuydirect_ca.py b/testing/webcompat/interventions/tests/test_1901000_eyebuydirect_ca.py @@ -1,142 +0,0 @@ -import time - -import pytest -from webdriver.error import NoSuchElementException - -URL = "https://www.eyebuydirect.ca/sunglasses" - -POPUP_CSS = ".ebd-modal-root" -GOOGLE_LOGIN_CSS = "#credential_picker_container" -FIRST_PRODUCT_CSS = "a[href^='https://www.eyebuydirect.ca/sunglasses/frames/']" -FIRST_FRAME_SIZE_CSS = "button[class*='size-list_size']" -SELECTED_FRAME_SIZE_CSS = "button[class*='size-list_size'][class*='size-list_current']" -SELECT_LENSES_CSS = "[aria-label='Select Lenses']" -NON_PRESCRIPTION_CSS = ".use-for-non-rx" -FIRST_COLOR_TYPE_CSS = "#color-type-container [data-option-name]" -BASIC_TYPE_CSS = "#sunglasses, #sunglasses-non-rx" -FIRST_COLOR_OPT_CSS = "[data-color-value-id]" -FIRST_COLOR_OPT_SELECTED_CSS = "[data-color-value-id].current" -CONFIRM_COLOR_BTN_CSS = "button.color-confirm" -STANDARD_LENSES_CSS = ".package-show.package-standard.lenses" -ADD_TO_CART_CSS = "button.btn-add-cart" -PAYPAL_CHECKOUT_CSS = "#paypal-checkout-button" -PAYPAL_OVERLAY_CSS = "[id^='paypal-overlay-uid']" - -NON_PRESCRIPTION_OPT_CSS = ( - "[class*=lens-prescription_select-lens] [aria-label^=Non-Prescription]" -) -NON_PRESCRIPTION_OPT_SELECTED_CSS = ( - "[aria-label^=Non-Prescription][class^=lens-prescription_selected]" -) - - -async def can_click_paypal_button(client): - await client.make_preload_script( - f""" - document.addEventListener("DOMContentLoaded", () => {{ - const s = document.createElement("style"); - s.textContent = "{POPUP_CSS}, {GOOGLE_LOGIN_CSS} {{ opacity:0 !important; pointer-events:none !important; }}"; - document.head.appendChild(s); - }}); - """ - ) - - await client.navigate(URL) - client.soft_click(client.await_css(FIRST_PRODUCT_CSS)) - - # we must wait for the DOM listeners to be added before the selectors will - # react, so just keep clicking and checking a few times until they do. - for tries in range(10): - non_rx = client.await_css(NON_PRESCRIPTION_OPT_CSS, is_displayed=True) - if client.find_css(NON_PRESCRIPTION_OPT_SELECTED_CSS, is_displayed=True): - break - non_rx.click() - time.sleep(0.5) - - try: - first_frame_size = client.await_css( - FIRST_FRAME_SIZE_CSS, is_displayed=True, timeout=4 - ) - if first_frame_size: - for tries in range(10): - first_frame_size.click() - time.sleep(0.5) - if client.find_css(SELECTED_FRAME_SIZE_CSS, is_displayed=True): - break - except NoSuchElementException: - pass - - client.click(client.await_css(SELECT_LENSES_CSS, is_displayed=True), force=True) - client.soft_click(client.await_css(FIRST_COLOR_TYPE_CSS, is_displayed=True)) - client.soft_click(client.await_css(BASIC_TYPE_CSS, is_displayed=True)) - - first_color_opt = client.await_css(FIRST_COLOR_OPT_CSS, is_displayed=True) - for tries in range(10): - if client.find_css(FIRST_COLOR_OPT_SELECTED_CSS, is_displayed=True): - break - first_color_opt.click() - time.sleep(0.5) - - client.soft_click(client.await_css(CONFIRM_COLOR_BTN_CSS, is_displayed=True)) - client.soft_click(client.await_css(STANDARD_LENSES_CSS, is_displayed=True)) - client.soft_click(client.await_css(ADD_TO_CART_CSS, is_displayed=True)) - - # Now the tricky parts begin. When we click on the PayPal button, if things - # are working then the PayPal iframe will receive the click event. But in - # the broken case, the underlying top frame will receive it instead. As such, - # we check which frame receives a mousedown. But in order to do so, we need - # to use chrome js functions, as WebDriver currently does not send mouse - # events via APZ. And we have to click a few times, as it's possible that the - # first clicks will still target the top frame, despite simulating APZ clicks. - frame = client.await_css(f"{PAYPAL_CHECKOUT_CSS} iframe") - - while True: - client.switch_to_frame(frame) - buttons = client.await_css("#buttons-container", timeout=20) - client.execute_script( - """ - arguments[0].addEventListener("mousedown", e => { - window.__clicked = true; - }, true); - """, - buttons, - ) - break - - client.switch_to_frame() - - # Now we mousedown over the PayPal button. Note that we only send mousedown - # events here to limit the chances that we will trigger any reaction from - # the page aside from our own mousedown-detection listener above. We try - # to mousedown multiple times as it does not always work the first time - # for some unknown reason (and may still fail outright intermittently). - for i in range(10): - await client.apz_down(element=frame) - time.sleep(0.2) - - client.switch_to_frame(frame) - return client.execute_script("return !!window.__clicked") - - -@pytest.mark.skip_platforms("android") -@pytest.mark.only_firefox_versions(max=134) -@pytest.mark.asyncio -@pytest.mark.with_interventions -async def test_enabled(client): - assert await can_click_paypal_button(client) - - -@pytest.mark.skip_platforms("android") -@pytest.mark.only_firefox_versions(max=134) -@pytest.mark.asyncio -@pytest.mark.without_interventions -async def test_disabled(client): - assert not await can_click_paypal_button(client) - - -@pytest.mark.skip_platforms("android") -@pytest.mark.only_firefox_versions(min=135) -@pytest.mark.asyncio -@pytest.mark.without_interventions -async def test_regression(client): - assert await can_click_paypal_button(client) diff --git a/testing/webcompat/interventions/tests/test_1928954_publix_com.py b/testing/webcompat/interventions/tests/test_1928954_publix_com.py @@ -1,21 +0,0 @@ -import pytest - -URL = "https://www.publix.com/" - -HERO_CSS = ".widget.banner.standard" -LINKS_CSS = "a[href^='javascript:EventBus'][href*=InstacartRedirectModal]" - - -async def does_have_bad_jslinks(client): - await client.make_preload_script( - "navigator.geolocation.getCurrentPosition = () => {}" - ) - await client.navigate(URL, wait="none") - client.await_css(HERO_CSS, is_displayed=True) - return 0 < len(client.await_css(LINKS_CSS, is_displayed=True, all=True)) - - -@pytest.mark.asyncio -@pytest.mark.without_interventions -async def test_regression(client): - assert await does_have_bad_jslinks(client)