mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-03-27 13:29:34 +07:00
17 lines
440 B
JavaScript
17 lines
440 B
JavaScript
import Analytics from './scripts/google-analytics.js';
|
|
|
|
addEventListener('unhandledrejection', async (event) => {
|
|
Analytics.fireErrorEvent(event.reason);
|
|
});
|
|
|
|
chrome.runtime.onInstalled.addListener(() => {
|
|
Analytics.fireEvent('install');
|
|
});
|
|
|
|
// Throw an exception after a timeout to trigger an exception analytics event
|
|
setTimeout(throwAnException, 2000);
|
|
|
|
async function throwAnException() {
|
|
throw new Error("👋 I'm an error");
|
|
}
|