Bug 1532346 - Beta/Release - Land WebCompat Release test interventions in tree. r=miketaylr a=lizzard DEVEDITION_66_0b14_BUILD1 DEVEDITION_66_0b14_RELEASE FIREFOX_66_0b14_BUILD1 FIREFOX_66_0b14_RELEASE
authorDennis Schubert <dschubert@mozilla.com>
Thu, 07 Mar 2019 10:44:44 +0100
changeset 516299 13bfcad39c39edcd4e3fc5b26fd62b25d338235f
parent 516298 8d7186b2f9a6cc4ac5f13fb4c97106de0fdbead8
child 516300 ba6658b59ed348f6c90799a99c9b8ae37c47023b
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmiketaylr, lizzard
bugs1532346
milestone66.0
Bug 1532346 - Beta/Release - Land WebCompat Release test interventions in tree. r=miketaylr a=lizzard Differential Revision: https://phabricator.services.mozilla.com/D22168
browser/extensions/webcompat/injections.js
browser/extensions/webcompat/injections/css/bug1526977-sreedharscce.in-login-fix.css
browser/extensions/webcompat/manifest.json
browser/extensions/webcompat/moz.build
browser/extensions/webcompat/ua_overrides.js
mobile/android/extensions/webcompat/injections.js
mobile/android/extensions/webcompat/injections/css/bug1526977-sreedharscce.in-login-fix.css
mobile/android/extensions/webcompat/injections/js/bug1522755-ebay-scroll-anchoring.js
mobile/android/extensions/webcompat/moz.build
mobile/android/extensions/webcompat/ua_overrides.js
--- a/browser/extensions/webcompat/injections.js
+++ b/browser/extensions/webcompat/injections.js
@@ -36,16 +36,20 @@ const contentScripts = {
       allFrames: true,
     },
     {
       matches: ["*://portalminasnet.com/*"],
       js: [{file: "injections/js/bug1482066-portalminasnet.com-window.sidebar-shim.js"}],
       runAt: "document_start",
       allFrames: true,
     },
+    {
+      matches: ["*://*.sreedharscce.in/authenticate"],
+      css: [{file: "injections/css/bug1526977-sreedharscce.in-login-fix.css"}],
+    },
   ],
   android: [],
 };
 
 /* globals browser */
 
 let port = browser.runtime.connect();
 let registeredContentScripts = [];
new file mode 100644
--- /dev/null
+++ b/browser/extensions/webcompat/injections/css/bug1526977-sreedharscce.in-login-fix.css
@@ -0,0 +1,12 @@
+/**
+ * sreedharscce.in - Fix login form with CSS intervention
+ * Bug #1526977 - https://bugzilla.mozilla.org/show_bug.cgi?id=1526977
+ * WebCompat issue #21505 - https://webcompat.com/issues/21505
+ *
+ * The login form is partly moved out of the screen on sreedharscce.in in
+ * Firefox. Enforcing the body height to the full viewport fixes this issue,
+ * as the login form itself is posititoned with `position: absolute;`.
+ */
+body {
+  height: 100vh;
+}
--- 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": "3.0.0",
+  "version": "3.0.1",
 
   "applications": {
     "gecko": {
       "id": "webcompat@mozilla.org",
       "strict_min_version": "59.0b5"
     }
   },
 
--- a/browser/extensions/webcompat/moz.build
+++ b/browser/extensions/webcompat/moz.build
@@ -11,17 +11,18 @@ FINAL_TARGET_FILES.features['webcompat@m
   'aboutConfigPrefs.js',
   'aboutConfigPrefs.json',
   'injections.js',
   'manifest.json',
   'ua_overrides.js'
 ]
 
 FINAL_TARGET_FILES.features['webcompat@mozilla.org']['injections']['css'] += [
-  'injections/css/bug0000000-dummy-css-injection.css'
+  'injections/css/bug0000000-dummy-css-injection.css',
+  'injections/css/bug1526977-sreedharscce.in-login-fix.css'
 ]
 
 FINAL_TARGET_FILES.features['webcompat@mozilla.org']['injections']['js'] += [
   'injections/js/bug0000000-dummy-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/bug1472081-election.gov.np-window.sidebar-shim.js',
--- a/browser/extensions/webcompat/ua_overrides.js
+++ b/browser/extensions/webcompat/ua_overrides.js
@@ -76,16 +76,38 @@ const UAOverrides = {
     {
       matches: ["*://tieba.baidu.com/*", "*://tiebac.baidu.com/*"],
       uaTransformer: (originalUA) => {
         return originalUA + " AppleWebKit/537.36 (KHTML, like Gecko)";
       },
     },
 
     /*
+     * Bug 1518625 - rottentomatoes.com - Add UA override for videos on www.rottentomatoes.com
+     *
+     * The video framework loaded in via pdk.theplatform.com fails to
+     * acknowledge that Firefox does support HLS, so it fails to find a
+     * supported video format and shows the loading bar forever. Spoofing as
+     * Chrome works.
+     *
+     * Contrary to other PDK sites, rottentomatoes sometimes uses an iFrame to
+     * player.theplatform.com to show a video, so we need to override that domain
+     * as well.
+     */
+    {
+      matches: [
+        "*://*.rottentomatoes.com/*",
+        "*://player.theplatform.com/*",
+      ],
+      uaTransformer: (_) => {
+        return "Mozilla/5.0 (Linux; Android 6.0.1; SM-G920F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.91 Mobile Safari/537.36";
+      },
+    },
+
+    /*
      * Bug 1177298 - Write UA overrides for top Japanese Sites
      * (Imported from ua-update.json.in)
      *
      * To receive the proper mobile version instead of the desktop version or
      * a lower grade mobile experience, the UA is spoofed.
      */
     {
       matches: ["*://weather.yahoo.co.jp/*"],
--- a/mobile/android/extensions/webcompat/injections.js
+++ b/mobile/android/extensions/webcompat/injections.js
@@ -36,31 +36,22 @@ const contentScripts = {
       allFrames: true,
     },
     {
       matches: ["*://portalminasnet.com/*"],
       js: [{file: "injections/js/bug1482066-portalminasnet.com-window.sidebar-shim.js"}],
       runAt: "document_start",
       allFrames: true,
     },
-  ],
-  android: [
     {
-      matches: [
-        "*://*.ebay.at/*", "*://*.ebay.be/*", "*://*.ebay.ca/*", "*://*.ebay.ch/*",
-        "*://*.ebay.cn/*", "*://*.ebay.co.th/*", "*://*.ebay.co.uk/*", "*://*.ebay.com.au/*",
-        "*://*.ebay.com.hk/*", "*://*.ebay.com.my/*", "*://*.ebay.com.sg/*", "*://*.ebay.com.tw/*",
-        "*://*.ebay.com/*", "*://*.ebay.de/*", "*://*.ebay.es/*", "*://*.ebay.fr/*",
-        "*://*.ebay.ie/*", "*://*.ebay.in/*", "*://*.ebay.it/*", "*://*.ebay.nl/*",
-        "*://*.ebay.ph/*", "*://*.ebay.pl/*", "*://*.ebay.vn/*",
-      ],
-      js: [{file: "injections/js/bug1522755-ebay-scroll-anchoring.js"}],
-      runAt: "document_idle",
+      matches: ["*://*.sreedharscce.in/authenticate"],
+      css: [{file: "injections/css/bug1526977-sreedharscce.in-login-fix.css"}],
     },
   ],
+  android: [],
 };
 
 /* globals browser */
 
 let port = browser.runtime.connect();
 let registeredContentScripts = [];
 
 async function registerContentScripts() {
new file mode 100644
--- /dev/null
+++ b/mobile/android/extensions/webcompat/injections/css/bug1526977-sreedharscce.in-login-fix.css
@@ -0,0 +1,12 @@
+/**
+ * sreedharscce.in - Fix login form with CSS intervention
+ * Bug #1526977 - https://bugzilla.mozilla.org/show_bug.cgi?id=1526977
+ * WebCompat issue #21505 - https://webcompat.com/issues/21505
+ *
+ * The login form is partly moved out of the screen on sreedharscce.in in
+ * Firefox. Enforcing the body height to the full viewport fixes this issue,
+ * as the login form itself is posititoned with `position: absolute;`.
+ */
+body {
+  height: 100vh;
+}
deleted file mode 100644
--- a/mobile/android/extensions/webcompat/injections/js/bug1522755-ebay-scroll-anchoring.js
+++ /dev/null
@@ -1,34 +0,0 @@
-"use strict";
-
-/**
- * ebay.com - Ebay jumps to the top once you scroll to the bottom on a mobile device
- * Bug #1522755 - https://bugzilla.mozilla.org/show_bug.cgi?id=1522755
- *
- * If scroll anchoring is enabled, scrolling all the way to the bottom causes the
- * site to scroll back up about half the page. See the bug linked above for a
- * detailed explanation.
- * Overriding the window.infinity.Page.prototype.hasVacancy with a version that
- * uses a cached clientHeight resolves this issue.
- *
- * NOTE: This script runs at document_idle, and this is important in order for us
- * to be able to override the method we want to override.
- */
-
-/* globals exportFunction */
-
-if (window.wrappedJSObject.infinity && window.wrappedJSObject.infinity.Page) {
-  console.info("window.infinity.Page.prototype.hasVacancy has been overriden for compatibility reasons. See https://bugzilla.mozilla.org/show_bug.cgi?id=1520666 for details.");
-
-  // Assign the current clientHeight initially, then only update the global
-  // variable on a resize event.
-  window.mozCompatCachedClientHeight = document.documentElement.clientHeight;
-  window.wrappedJSObject.addEventListener("resize", (exportFunction(function() {
-    window.mozCompatCachedClientHeight = document.documentElement.clientHeight;
-  }, window)));
-
-  // Replace the original window.infinity.Page.prototype.hasVacancy method with
-  // a copied implementation using our cached client height.
-  window.wrappedJSObject.infinity.Page.prototype.hasVacancy = (exportFunction(function() {
-    return this.height < window.mozCompatCachedClientHeight * 3;
-  }, window));
-}
--- a/mobile/android/extensions/webcompat/moz.build
+++ b/mobile/android/extensions/webcompat/moz.build
@@ -11,23 +11,23 @@ FINAL_TARGET_FILES.features['webcompat@m
   'aboutConfigPrefs.js',
   'aboutConfigPrefs.json',
   'injections.js',
   'manifest.json',
   'ua_overrides.js'
 ]
 
 FINAL_TARGET_FILES.features['webcompat@mozilla.org']['injections']['css'] += [
-  'injections/css/bug0000000-dummy-css-injection.css'
+  'injections/css/bug0000000-dummy-css-injection.css',
+  'injections/css/bug1526977-sreedharscce.in-login-fix.css'
 ]
 
 FINAL_TARGET_FILES.features['webcompat@mozilla.org']['injections']['js'] += [
   'injections/js/bug0000000-dummy-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/bug1472081-election.gov.np-window.sidebar-shim.js',
-  'injections/js/bug1482066-portalminasnet.com-window.sidebar-shim.js',
-  'injections/js/bug1522755-ebay-scroll-anchoring.js'
+  'injections/js/bug1482066-portalminasnet.com-window.sidebar-shim.js'
 ]
 
 with Files('**'):
   BUG_COMPONENT = ('Web Compatibility Tools', 'Go Faster')
--- a/mobile/android/extensions/webcompat/ua_overrides.js
+++ b/mobile/android/extensions/webcompat/ua_overrides.js
@@ -76,16 +76,38 @@ const UAOverrides = {
     {
       matches: ["*://tieba.baidu.com/*", "*://tiebac.baidu.com/*"],
       uaTransformer: (originalUA) => {
         return originalUA + " AppleWebKit/537.36 (KHTML, like Gecko)";
       },
     },
 
     /*
+     * Bug 1518625 - rottentomatoes.com - Add UA override for videos on www.rottentomatoes.com
+     *
+     * The video framework loaded in via pdk.theplatform.com fails to
+     * acknowledge that Firefox does support HLS, so it fails to find a
+     * supported video format and shows the loading bar forever. Spoofing as
+     * Chrome works.
+     *
+     * Contrary to other PDK sites, rottentomatoes sometimes uses an iFrame to
+     * player.theplatform.com to show a video, so we need to override that domain
+     * as well.
+     */
+    {
+      matches: [
+        "*://*.rottentomatoes.com/*",
+        "*://player.theplatform.com/*",
+      ],
+      uaTransformer: (_) => {
+        return "Mozilla/5.0 (Linux; Android 6.0.1; SM-G920F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.91 Mobile Safari/537.36";
+      },
+    },
+
+    /*
      * Bug 1177298 - Write UA overrides for top Japanese Sites
      * (Imported from ua-update.json.in)
      *
      * To receive the proper mobile version instead of the desktop version or
      * a lower grade mobile experience, the UA is spoofed.
      */
     {
       matches: ["*://weather.yahoo.co.jp/*"],