bug1934908-www.cbsnews.com-ua-override.js (1153B)
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 1934908 - www.cbsnews.com - Override UA on Android to use JS HLS player 9 * Spoofing as Chrome forces the site’s HLS.js player. Native HLS is controlled 10 * by media.hls.enabled, which defaults to false. When false, video doesn't 11 * play back at all. When true, video will play back for a minute or two before 12 * stopping. With this override video playback works consistently regardless of 13 * how media.hls.enabled is configured. 14 */ 15 16 /* globals exportFunction, UAHelpers */ 17 console.info( 18 "The user agent has been overridden for compatibility reasons. See https://bugzilla.mozilla.org/show_bug.cgi?id=1934908 for details." 19 ); 20 21 UAHelpers.overrideWithDeviceAppropriateChromeUA(); 22 const nav = Object.getPrototypeOf(navigator.wrappedJSObject); 23 const vendorDesc = Object.getOwnPropertyDescriptor(nav, "vendor"); 24 vendorDesc.get = exportFunction(() => "Google Inc.", window); 25 Object.defineProperty(nav, "vendor", vendorDesc);