tor-browser

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

bug1902419-www.jamsune.com-prevent-unsupported-alert.js (752B)


      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 /* globals exportFunction */
      6 
      7 "use strict";
      8 
      9 /**
     10 * www.jamsune.com - Shows an alert recommending other browsers.
     11 * Bug #1902419 - https://bugzilla.mozilla.org/show_bug.cgi?id=1902419
     12 */
     13 
     14 console.info(
     15  "window.alert is being overriden for compatibility reasons. See https://bugzilla.mozilla.org/show_bug.cgi?id=1902419 for details."
     16 );
     17 
     18 const originalAlert = window.wrappedJSObject.alert;
     19 window.wrappedJSObject.alert = exportFunction(function (msg) {
     20  if (!msg?.toLowerCase?.().includes("크롬")) {
     21    originalAlert(msg);
     22  }
     23 }, window);