bug1959598-www.signal-tech.com-round-pageYOffset.js (701B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 "use strict"; 6 7 /** 8 * Bug 1959598 - new products do not load in while scrolling at certain zoom values 9 * 10 * The page's logic seems to rely on integer values being returned by window.pageYOffset. 11 */ 12 13 /* globals exportFunction */ 14 15 const win = window.wrappedJSObject; 16 const pyo = Object.getOwnPropertyDescriptor(win, "pageYOffset"); 17 const pyoGet = pyo.get; 18 pyo.get = exportFunction(function () { 19 return Math.round(pyoGet.call(this)); 20 }, window); 21 Object.defineProperty(win, "pageYOffset", pyo);