Bug 1637672 - Import WebCompat Interventions v12.0.0 sources. r=twisniewski,webcompat-reviewers
authorDennis Schubert <dschubert@mozilla.com>
Tue, 23 Jun 2020 14:09:10 +0000
changeset 536983 098a3557e947cd7ab1b26987434b326427253b91
parent 536982 8abffeca377d9e9d040ae2f941073cc15b7efc44
child 536984 6a2fc579cd075012e868f98f6998262ae6aa7756
push id119750
push userdschubert@mozilla.com
push dateTue, 23 Jun 2020 20:32:04 +0000
treeherderautoland@098a3557e947 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstwisniewski, webcompat-reviewers
bugs1637672
milestone79.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1637672 - Import WebCompat Interventions v12.0.0 sources. r=twisniewski,webcompat-reviewers Differential Revision: https://phabricator.services.mozilla.com/D80657
browser/extensions/webcompat/data/injections.js
browser/extensions/webcompat/data/ua_overrides.js
browser/extensions/webcompat/experiment-apis/pictureInPicture.js
browser/extensions/webcompat/injections/css/bug1577270-binance.com-calc-height-fix.css
browser/extensions/webcompat/injections/css/bug1633796-www-la-poste-fr-placeholder-fix.css
browser/extensions/webcompat/injections/css/bug1644830-missingmail.usps.com-checkboxes-not-visible.css
browser/extensions/webcompat/injections/css/bug1645064-s-kanava.fi-invisible-charts.css
browser/extensions/webcompat/injections/js/bug1641998-embedded-twitter-videos-etp-indexeddb.js
browser/extensions/webcompat/manifest.json
browser/extensions/webcompat/moz.build
--- a/browser/extensions/webcompat/data/injections.js
+++ b/browser/extensions/webcompat/data/injections.js
@@ -259,30 +259,16 @@ const AVAILABLE_INJECTIONS = [
         {
           file:
             "injections/css/bug1575000-apply.lloydsbank.co.uk-radio-buttons-fix.css",
         },
       ],
     },
   },
   {
-    id: "bug1577270",
-    platform: "android",
-    domain: "binance.com",
-    bug: "1577270",
-    contentScripts: {
-      matches: ["*://*.binance.com/*"],
-      css: [
-        {
-          file: "injections/css/bug1577270-binance.com-calc-height-fix.css",
-        },
-      ],
-    },
-  },
-  {
     id: "bug1577297",
     platform: "android",
     domain: "kitkat.com.au",
     bug: "1577297",
     contentScripts: {
       matches: ["*://*.kitkat.com.au/*"],
       css: [
         {
@@ -421,24 +407,55 @@ const AVAILABLE_INJECTIONS = [
       css: [
         {
           file: "injections/css/bug1632019-everyman.co-gallery-width-fix.css",
         },
       ],
     },
   },
   {
-    id: "bug1633796",
-    platform: "android",
-    domain: "www.laposte.fr",
-    bug: "1633796",
+    id: "bug1644830",
+    platform: "desktop",
+    domain: "usps.com",
+    bug: "1644830",
     contentScripts: {
-      matches: ["https://www.laposte.fr/*"],
+      matches: ["https://*.usps.com/*"],
       css: [
         {
-          file: "injections/css/bug1633796-www-la-poste-fr-placeholder-fix.css",
+          file:
+            "injections/css/bug1644830-missingmail.usps.com-checkboxes-not-visible.css",
+        },
+      ],
+    },
+  },
+  {
+    id: "bug1645064",
+    platform: "desktop",
+    domain: "s-kanava.fi",
+    bug: "1645064",
+    contentScripts: {
+      matches: ["https://www.s-kanava.fi/*"],
+      css: [
+        {
+          file: "injections/css/bug1645064-s-kanava.fi-invisible-charts.css",
+        },
+      ],
+    },
+  },
+  {
+    id: "bug1641998",
+    platform: "desktop",
+    domain: "twitter.com",
+    bug: "1641998",
+    contentScripts: {
+      matches: ["https://twitter.com/i/videos/tweet/*"],
+      allFrames: true,
+      js: [
+        {
+          file:
+            "injections/js/bug1641998-embedded-twitter-videos-etp-indexeddb.js",
         },
       ],
     },
   },
 ];
 
 module.exports = AVAILABLE_INJECTIONS;
--- a/browser/extensions/webcompat/data/ua_overrides.js
+++ b/browser/extensions/webcompat/data/ua_overrides.js
@@ -453,38 +453,16 @@ const AVAILABLE_UA_OVERRIDES = [
         }
 
         return originalUA;
       },
     },
   },
   {
     /*
-     * Bug 1610370 - UA override for answers.yahoo.com on Firefox for Android
-     * WebCompat issue #5460 - https://webcompat.com/issues/5460
-     *
-     * answers.yahoo.com is not showing lazy loaded content based on UA detection
-     * When spoofing as Chrome it's possible to load the content
-     */
-    id: "bug1610370",
-    platform: "android",
-    domain: "answers.yahoo.com",
-    bug: "1610370",
-    config: {
-      matches: ["https://answers.yahoo.com/*"],
-      uaTransformer: originalUA => {
-        return (
-          UAHelpers.getPrefix(originalUA) +
-          " AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Mobile Safari/537.36"
-        );
-      },
-    },
-  },
-  {
-    /*
      * Bug 1595215 - UA overrides for Uniqlo sites
      * Webcompat issue #38825 - https://webcompat.com/issues/38825
      *
      * To receive the proper mobile version instead of the desktop version or
      * avoid redirect loop, the UA is spoofed.
      */
     id: "bug1595215",
     platform: "android",
@@ -610,16 +588,43 @@ const AVAILABLE_UA_OVERRIDES = [
     bug: "1630280",
     config: {
       matches: ["https://*.dominos.ch/*"],
       uaTransformer: () => {
         return UAHelpers.getDeviceAppropriateChromeUA();
       },
     },
   },
+  {
+    /*
+     * Bug 1563839 - rolb.santanderbank.com - Build UA override
+     * Bug 1646791 - bancosantander.es - Re-add UA override.
+     * WebCompat issue #33462 - https://webcompat.com/issues/33462
+     * SuMo request - https://support.mozilla.org/es/questions/1291085
+     *
+     * santanderbank expects UA to have 'like Gecko', otherwise it runs
+     * xmlDoc.onload whose support has been dropped. It results in missing labels in forms
+     * and some other issues.  Adding 'like Gecko' fixes those issues.
+     */
+    id: "bug1563839",
+    platform: "all",
+    domain: "santanderbank.com",
+    bug: "1563839",
+    config: {
+      matches: [
+        "*://*.bancosantander.es*",
+        "*://*.santander.co.uk/*",
+        "*://bob.santanderbank.com/*",
+        "*://rolb.santanderbank.com/*",
+      ],
+      uaTransformer: originalUA => {
+        return originalUA.replace("Gecko", "like Gecko");
+      },
+    },
+  },
 ];
 
 const UAHelpers = {
   getDeviceAppropriateChromeUA() {
     if (!UAHelpers._deviceAppropriateChromeUA) {
       const userAgent =
         typeof navigator !== "undefined" ? navigator.userAgent : "";
       const RunningFirefoxVersion = (userAgent.match(/Firefox\/([0-9.]+)/) || [
--- a/browser/extensions/webcompat/experiment-apis/pictureInPicture.js
+++ b/browser/extensions/webcompat/experiment-apis/pictureInPicture.js
@@ -59,17 +59,17 @@ this.pictureInPictureParent = class exte
 this.pictureInPictureChild = class extends ExtensionAPI {
   getAPI(context) {
     return {
       pictureInPictureChild: {
         getPolicies() {
           // The Picture-in-Picture toggle is only implemented for Desktop, so make
           // this return nothing for non-Desktop builds.
           if (AppConstants.platform == "android") {
-            return {};
+            return Cu.cloneInto({}, context.cloneScope);
           }
 
           return Cu.cloneInto(TOGGLE_POLICIES, context.cloneScope);
         },
       },
     };
   }
 };
deleted file mode 100644
--- a/browser/extensions/webcompat/injections/css/bug1577270-binance.com-calc-height-fix.css
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * binance.com - can't see the full site
- * Bug #1577270 - https://bugzilla.mozilla.org/show_bug.cgi?id=1577270
- * WebCompat issue #17810 - https://webcompat.com/issues/17810
- *
- * The site does not have a doctype and is rendered in quirks mode. The calc() percentage
- * height is applied on the .main-page .viewWrap element, but its parent does not have
- * a specified height property. Adding a height of 100% to the parent fixes the issue.
- */
-#tradeDiv {
-  height: 100%;
-}
deleted file mode 100644
--- a/browser/extensions/webcompat/injections/css/bug1633796-www-la-poste-fr-placeholder-fix.css
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * www.laposte.fr - Account credentials overlap placeholder text
- * Bug #1633796 - https://bugzilla.mozilla.org/show_bug.cgi?id=1633796
- * WebCompat issue #52274 - https://webcompat.com/issues/52274
- *
- * The login form for www.laposte.fr uses a positioned label as
- * placeholder text, and relies on focus to move it. However, Firefox
- * does not currently support unprefixed :read-only, so the entire
- * rule is discarded. Until https://bugzilla.mozilla.org/show_bug.cgi?id=312971
- * ships, we can work around this by rewriting the rule.
- */
-
-.flottingLabel .group input:focus ~ label,
-.flottingLabel .group input:valid ~ label,
-.flottingLabel .group input:-moz-read-only ~ label,
-.flottingLabel .group input.flatpickr-input ~ label,
-.flottingLabel .group input:disabled ~ label {
-  color: #606060;
-  font-size: 0.625em;
-  top: 0;
-}
new file mode 100644
--- /dev/null
+++ b/browser/extensions/webcompat/injections/css/bug1644830-missingmail.usps.com-checkboxes-not-visible.css
@@ -0,0 +1,14 @@
+/**
+ * missingmail.usps.com - Unable to mark the check-boxes from "Disclaimer and
+ * Terms and Conditions" section
+ * Bug #1644830 - https://bugzilla.mozilla.org/show_bug.cgi?id=1644830
+ * WebCompat issue #53950 - https://webcompat.com/issues/53950
+ *
+ * missingmail.usps.com runs into a case of bug 997189, where an absolutely
+ * positioned inline-block element with floating siblings is shifter to the
+ * right, and thus invisible.
+ */
+.mrc-custom-checkbox-container input {
+  top: 0;
+  left: 0;
+}
new file mode 100644
--- /dev/null
+++ b/browser/extensions/webcompat/injections/css/bug1645064-s-kanava.fi-invisible-charts.css
@@ -0,0 +1,12 @@
+/**
+ * s-kanava.fi - The tables carousel is missing
+ * Bug #1645064 - https://bugzilla.mozilla.org/show_bug.cgi?id=1645064
+ * WebCompat issue #53584 - https://webcompat.com/issues/53584
+ *
+ * This site runs into a known Flex issue, see bug 1469649. However, the issue
+ * is easy to workaround in this case by explicitly specifying the width of
+ * the flex container.
+ */
+.carousel .slider-wrapper.axis-horizontal .slider .slide {
+  max-width: 100%;
+}
new file mode 100644
--- /dev/null
+++ b/browser/extensions/webcompat/injections/js/bug1641998-embedded-twitter-videos-etp-indexeddb.js
@@ -0,0 +1,24 @@
+"use strict";
+
+/**
+ * Bug 1641998 - Embedded Twitter videos - Override indexedDB API
+ * See also: https://bugzilla.mozilla.org/show_bug.cgi?id=1641521
+ *
+ * With ETP enabled, embedded Twitter videos break. This is caused by Twitter
+ * trying to access the indexedDB API for testing if the API is there, without
+ * anticipating the potential for a SecurityError to be thrown.
+ *
+ * This site patch sets window.indexedDB to undefined so their detection can
+ * work correctly.
+ */
+
+/* globals exportFunction */
+
+console.info(
+  "window.indexedDB has been overwritten for compatibility reasons. See https://bugzilla.mozilla.org/show_bug.cgi?id=1641521 for details."
+);
+
+Object.defineProperty(window.wrappedJSObject, "indexedDB", {
+  get: undefined,
+  set: undefined,
+});
--- a/browser/extensions/webcompat/manifest.json
+++ b/browser/extensions/webcompat/manifest.json
@@ -1,13 +1,13 @@
 {
   "manifest_version": 2,
   "name": "Web Compat",
   "description": "Urgent post-release fixes for web compatibility.",
-  "version": "11.0.0",
+  "version": "12.0.0",
 
   "applications": {
     "gecko": {
       "id": "webcompat@mozilla.org",
       "strict_min_version": "59.0b5"
     }
   },
 
--- a/browser/extensions/webcompat/moz.build
+++ b/browser/extensions/webcompat/moz.build
@@ -44,38 +44,39 @@ FINAL_TARGET_FILES.features['webcompat@m
 FINAL_TARGET_FILES.features['webcompat@mozilla.org']['injections']['css'] += [
   'injections/css/bug0000000-testbed-css-injection.css',
   'injections/css/bug1561371-mail.google.com-allow-horizontal-scrolling.css',
   'injections/css/bug1567610-dns.google.com-moz-fit-content.css',
   'injections/css/bug1568908-console.cloud.google.com-scrollbar-fix.css',
   'injections/css/bug1570119-teamcoco.com-scrollbar-width.css',
   'injections/css/bug1570328-developer-apple.com-transform-scale.css',
   'injections/css/bug1575000-apply.lloydsbank.co.uk-radio-buttons-fix.css',
-  'injections/css/bug1577270-binance.com-calc-height-fix.css',
   'injections/css/bug1577297-kitkat.com.au-slider-width-fix.css',
   'injections/css/bug1605611-maps.google.com-directions-time.css',
   'injections/css/bug1609991-cracked.com-flex-basis-fix.css',
   'injections/css/bug1610016-gaana.com-input-position-fix.css',
   'injections/css/bug1610344-directv.com.co-hide-unsupported-message.css',
   'injections/css/bug1631960-websube.ckbogazici.com.tr-table-row-fix.css',
   'injections/css/bug1632019-everyman.co-gallery-width-fix.css',
-  'injections/css/bug1633796-www-la-poste-fr-placeholder-fix.css',
+  'injections/css/bug1644830-missingmail.usps.com-checkboxes-not-visible.css',
+  'injections/css/bug1645064-s-kanava.fi-invisible-charts.css',
 ]
 
 FINAL_TARGET_FILES.features['webcompat@mozilla.org']['injections']['js'] += [
   'injections/js/bug0000000-testbed-js-injection.js',
   'injections/js/bug1452707-window.controllers-shim-ib.absa.co.za.js',
   'injections/js/bug1457335-histography.io-ua-change.js',
   'injections/js/bug1472075-bankofamerica.com-ua-change.js',
   'injections/js/bug1570856-medium.com-menu-isTier1.js',
   'injections/js/bug1579159-m.tailieu.vn-pdfjs-worker-disable.js',
   'injections/js/bug1605611-maps.google.com-directions-time.js',
   'injections/js/bug1610358-pcloud.com-appVersion-change.js',
   'injections/js/bug1623375-salesforce-communities-hide-unsupported.js',
   'injections/js/bug1625224-sixt-neuwagen.de-window-netscape-shim.js',
+  'injections/js/bug1641998-embedded-twitter-videos-etp-indexeddb.js',
 ]
 
 FINAL_TARGET_FILES.features['webcompat@mozilla.org']['lib'] += [
   'lib/about_compat_broker.js',
   'lib/custom_functions.js',
   'lib/injections.js',
   'lib/intervention_helpers.js',
   'lib/module_shim.js',