commit 4e9f34a98955e4c2d6751175bfb8f955afc4516a
parent 1fda937152c2eefc9c56f546dea6add88f86479b
Author: Thomas Wisniewski <twisniewski@mozilla.com>
Date: Fri, 17 Oct 2025 21:02:59 +0000
Bug 1927121 - add a JS webcompat intervention for southerndevilhd.com; r=webcompat-reviewers,ksenia
Differential Revision: https://phabricator.services.mozilla.com/D269110
Diffstat:
3 files changed, 60 insertions(+), 0 deletions(-)
diff --git a/browser/extensions/webcompat/data/interventions.json b/browser/extensions/webcompat/data/interventions.json
@@ -3802,6 +3802,25 @@
}
]
},
+ "1927121": {
+ "label": "southerndevilhd.com",
+ "bugs": {
+ "1927121": {
+ "issue": "broken-images",
+ "matches": ["*://www.southerndevilhd.com/*"]
+ }
+ },
+ "interventions": [
+ {
+ "platforms": ["all"],
+ "content_scripts": {
+ "js": [
+ "bug1927121-southerndevilhd.com-shim-WebkitMutationObserver.js"
+ ]
+ }
+ }
+ ]
+ },
"1927984": {
"label": "modules.sms-timing.com",
"bugs": {
diff --git a/browser/extensions/webcompat/injections/js/bug1927121-southerndevilhd.com-shim-WebkitMutationObserver.js b/browser/extensions/webcompat/injections/js/bug1927121-southerndevilhd.com-shim-WebkitMutationObserver.js
@@ -0,0 +1,21 @@
+/* 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 1927121 - southerndevilhd.com product thumbnails do not appear
+ *
+ * The page relies on the non-standard WebKitMutationObserver,
+ * which we can simply alias to MutationObserver.
+ */
+
+/* globals exportFunction */
+
+console.info(
+ "WebKitMutationObserver has been shimmed for compatibility reasons. See https://bugzilla.mozilla.org/show_bug.cgi?id=1927121 for details."
+);
+
+window.wrappedJSObject.WebKitMutationObserver =
+ window.wrappedJSObject.MutationObserver;
diff --git a/testing/webcompat/interventions/tests/test_1927121_southerndevilhd_com.py b/testing/webcompat/interventions/tests/test_1927121_southerndevilhd_com.py
@@ -0,0 +1,20 @@
+import pytest
+
+URL = (
+ "https://www.southerndevilhd.com/default.asp?page=xallinventory&customSearch=harley"
+)
+GOOD_CSS = ".vehicle__image.b-loaded[style*=background-image]"
+BAD_MSG = "WebKitMutationObserver is not defined"
+
+
+@pytest.mark.asyncio
+@pytest.mark.with_interventions
+async def test_enabled(client):
+ await client.navigate(URL, wait="none")
+ assert client.await_css(GOOD_CSS, is_displayed=True)
+
+
+@pytest.mark.asyncio
+@pytest.mark.without_interventions
+async def test_disabled(client):
+ await client.navigate(URL, await_console_message=BAD_MSG)