grungnet/src/index.js

87 lines
2.9 KiB
JavaScript
Raw Normal View History

2020-03-15 02:50:56 -04:00
import React from "react";
import ReactDOM from "react-dom";
2020-10-26 17:02:41 -04:00
import * as Sentry from "@sentry/react";
2020-03-15 02:50:56 -04:00
import App from "./App";
import Modal from "react-modal";
// Add css for simplebar
import "simplebar/dist/simplebar.min.css";
2020-03-15 02:50:56 -04:00
import * as serviceWorker from "./serviceWorker";
2020-03-15 01:04:30 -04:00
import "./index.css";
2021-03-16 01:13:48 -04:00
// Pointer events shim
if (!("PointerEvent" in window)) {
import("pepjs");
}
if (process.env.REACT_APP_LOGGING === "true") {
Sentry.init({
2021-04-21 04:56:43 -04:00
dsn: process.env.REACT_APP_SENTRY_DSN,
release: "owlbear-rodeo@" + process.env.REACT_APP_VERSION,
// Ignore resize error as it is triggered by going fullscreen on slower computers
2020-11-27 16:51:56 -05:00
// Ignore quota error
2020-11-27 16:55:25 -05:00
// Ignore XDR encoding failure bug in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1678243
2021-01-13 20:37:46 -05:00
// Ignore LastPass extension text error
2021-02-08 16:11:24 -05:00
// Ignore chrome extension error
2021-02-23 17:12:42 -05:00
// Ignore dexie error todo: fix
ignoreErrors: [
"ResizeObserver loop limit exceeded",
2020-11-27 16:55:25 -05:00
"QuotaExceededError",
"XDR encoding failure",
2021-01-13 20:37:46 -05:00
"Assertion failed: Input argument is not an HTMLInputElement",
2021-02-08 16:11:24 -05:00
"Extension context invalidated",
2021-03-14 21:46:14 -04:00
new RegExp(
"([InvalidStateError:\\s]*Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing([.]*[\\s]*))+"
),
// Random plugins/extensions
"top.GLOBALS",
// See: http://blog.errorception.com/2012/03/tale-of-unfindable-js-error.html
"originalCreateNotification",
"canvas.contentDocument",
"MyApp_RemoveAllHighlights",
"http://tt.epicplay.com",
"Can't find variable: ZiteReader",
"jigsaw is not defined",
"ComboSearch is not defined",
"http://loading.retry.widdit.com/",
"atomicFindClose",
// Facebook borked
"fb_xd_fragment",
// ISP "optimizing" proxy - `Cache-Control: no-transform` seems to
// reduce this. (thanks @acdha)
// See http://stackoverflow.com/questions/4113268
"bmi_SafeAddOnload",
"EBCallBackMessageReceived",
// See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx
"conduitPage",
],
denyUrls: [
// Facebook flakiness
/graph\.facebook\.com/i,
// Facebook blocked
/connect\.facebook\.net\/en_US\/all\.js/i,
// Woopra flakiness
/eatdifferent\.com\.woopra-ns\.com/i,
/static\.woopra\.com\/js\/woopra\.js/i,
// Chrome extensions
/extensions\//i,
/^chrome:\/\//i,
// Other plugins
/127\.0\.0\.1:4001\/isrunning/i, // Cacaoweb
/webappstoolbarba\.texthelp\.com\//i,
/metrics\.itunes\.apple\.com\.edgesuite\.net\//i,
],
});
}
2020-10-26 17:02:41 -04:00
Modal.setAppElement("#root");
2020-03-15 01:04:30 -04:00
ReactDOM.render(<App />, document.getElementById("root"));
2020-03-15 01:04:30 -04:00
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();