tor-browser

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

bug1850998-chaturbate.com.js (849B)


      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 1850998 - going "fullscreen" does not hide the address bar
      9 *
     10 * The site avoids calling requestFullScreen on Firefox. We can address
     11 * this by pretending to not be Firefox for that specific check.
     12 */
     13 
     14 /* globals exportFunction */
     15 
     16 const proto = window.wrappedJSObject.RegExp.prototype;
     17 const descriptor = Object.getOwnPropertyDescriptor(proto, "test");
     18 const { value } = descriptor;
     19 
     20 descriptor.value = exportFunction(function (test) {
     21  if (this.source === "UCBrowser|Firefox|SamsungBrowser") {
     22    return false;
     23  }
     24  return value.call(this, test);
     25 }, window);
     26 
     27 Object.defineProperty(proto, "test", descriptor);