fune/mobile/android/extensions/webcompat/injections/js/bug1482066-portalminasnet.com-window.sidebar-shim.js
Victor Porof e999ae1989 Bug 1561435 - Format mobile/, a=automatic-formatting
# ignore-this-changeset

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

--HG--
extra : source : eafb1052afc7712c969e57552da5affc63093e9e
2019-07-05 10:53:35 +02:00

25 lines
744 B
JavaScript

"use strict";
/**
* portalminasnet.com - Override window.sidebar with something falsey
* WebCompat issue #18143 - https://webcompat.com/issues/18143
*
* This site is blocking onmousedown and onclick if window.sidebar is something
* that evaluates to true, rendering the login unusable. This patch overrides
* window.sidebar with false, so the blocking event handlers won't get
* registered.
*/
/* globals exportFunction */
console.info(
"window.sidebar has been shimmed for compatibility reasons. See https://webcompat.com/issues/18143 for details."
);
Object.defineProperty(window.wrappedJSObject, "sidebar", {
get: exportFunction(function() {
return false;
}, window),
set: exportFunction(function() {}, window),
});