From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- ...452707-window.controllers-shim-ib.absa.co.za.js | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 browser/extensions/webcompat/injections/js/bug1452707-window.controllers-shim-ib.absa.co.za.js (limited to 'browser/extensions/webcompat/injections/js/bug1452707-window.controllers-shim-ib.absa.co.za.js') diff --git a/browser/extensions/webcompat/injections/js/bug1452707-window.controllers-shim-ib.absa.co.za.js b/browser/extensions/webcompat/injections/js/bug1452707-window.controllers-shim-ib.absa.co.za.js new file mode 100644 index 0000000000..40e17b4a36 --- /dev/null +++ b/browser/extensions/webcompat/injections/js/bug1452707-window.controllers-shim-ib.absa.co.za.js @@ -0,0 +1,33 @@ +/* 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 1452707 - Build site patch for ib.absa.co.za + * WebCompat issue #16401 - https://webcompat.com/issues/16401 + * + * The online banking at ib.absa.co.za detect if window.controllers is a + * non-falsy value to detect if the current browser is Firefox or something + * else. In bug 1448045, this shim has been disabled for Firefox Nightly 61+, + * which breaks the UA detection on this site and results in a "Browser + * unsuppored" error message. + * + * This site patch simply sets window.controllers to a string, resulting in + * their check to work again. + */ + +/* globals exportFunction */ + +console.info( + "window.controllers has been shimmed for compatibility reasons. See https://webcompat.com/issues/16401 for details." +); + +Object.defineProperty(window.wrappedJSObject, "controllers", { + get: exportFunction(function () { + return true; + }, window), + + set: exportFunction(function () {}, window), +}); -- cgit v1.2.3