tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

bug1905069-one.geekie.com.br-chrome-shims.js (944B)


      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 1905069 - UA spoof for one.geekie.com.br
      9 *
     10 * This site is checking for window.chrome and navigator.vendor, so let's spoof those.
     11 */
     12 
     13 /* globals exportFunction */
     14 
     15 console.info(
     16  "window.chrome and navigator.vendor have been shimmed for compatibility reasons. See https://bugzilla.mozilla.org/show_bug.cgi?id=1905069 for details."
     17 );
     18 
     19 Object.defineProperty(window.wrappedJSObject, "chrome", {
     20  get: exportFunction(function () {
     21    return true;
     22  }, window),
     23 
     24  set: exportFunction(function () {}, window),
     25 });
     26 
     27 Object.defineProperty(window.navigator.wrappedJSObject, "vendor", {
     28  get: exportFunction(function () {
     29    return "Google Inc.";
     30  }, window),
     31 
     32  set: exportFunction(function () {}, window),
     33 });