Skip to content

Instantly share code, notes, and snippets.

View riccardogiorato's full-sized avatar
🏠
Working from home

Riccardo Giorato riccardogiorato

🏠
Working from home
View GitHub Profile
<button
onClick={() => {
throw "Sentry is perfect and it catches every error!";
}}
>
This button creates an error!
</button>
Sentry.configureScope(function(scope) {
scope.setUser({"email": "[email protected]"});
});
# Using yarn
$ yarn add @sentry/browser
# Using npm
$ npm install @sentry/browser
import React from 'react';
import * as Sentry from '@sentry/browser';
import App from 'src/App';
Sentry.init({dsn: "https://[email protected]/<project>"});
ReactDOM.render(<App />, document.getElementById('root'));
<script>
window['_fs_debug'] = false;
window['_fs_host'] = 'fullstory.com';
window['_fs_org'] = 'P71AM';
window['_fs_namespace'] = 'FS';
(function(m,n,e,t,l,o,g,y){
if (e in m) {if(m.console && m.console.log) { m.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].');} return;}
g=m[e]=function(a,b,s){g.q?g.q.push([a,b,s]):g._api(a,b,s);};g.q=[];
o=n.createElement(t);o.async=1;o.crossOrigin='anonymous';o.src='https://'+_fs_host+'/s/fs.js';
y=n.getElementsByTagName(t)[0];y.parentNode.insertBefore(o,y);
(function(document, window){
var styleText = '::-moz-focus-inner{border:0 !important;}:focus{outline: none !important;';
var unfocus_style = document.createElement('STYLE');
window.unfocus = function(){
document.getElementsByTagName('HEAD')[0].appendChild(unfocus_style);
document.addEventListener('mousedown', function(){
unfocus_style.innerHTML = styleText+'}';
});
<div tabindex="0" role="button">
  This is a div but I'm a button for 
</div>
<a tabindex="0" role="button">
This is a Link but I'm a button for Screen readers
</a>
<h2>GOOD BUTTONS</h2>
<button onclick="saveButton()" >Save Button</button>
<button href="/newpage/file">Button</button>
<h2>BAD BUTTONS</h2>
<button onclick="window.location('www.google.com')">B</button>
<button href="www.google.com">B</button>