diff --git a/packages/js/examples/chrome-extension/README.md b/packages/js/examples/chrome-extension/README.md index f280a15b..1a96b164 100644 --- a/packages/js/examples/chrome-extension/README.md +++ b/packages/js/examples/chrome-extension/README.md @@ -22,8 +22,9 @@ In the Extensions page (`chrome://extensions`), click on the re There are multiple ways to report an error, showcasing the different execution contexts in a chrome extension: - An error is automatically reported from the background worker (`background.js`) as soon as it's loaded. This is how you know Honeybadger was loaded successfully in the worker. - An error is automatically reported from the content script (`content.js`) as soon as it's loaded. This is how you know Honeybadger was loaded successfully in the content script. -- To report an error from the options page (`options.html` and `options.js`): +- To report an error from the options page (`options.html` and `options.js`) or the popup (`popup.html` and `popup.js`): 1. Open `error-reporting.js` and replace `YOUR_API_KEY` with your Honeybadger.js API key. 2. Make sure to reload the extension (see above). 3. Open the Options page and click on the Report Error button. + Or click on the extension icon to open the popup and click on the Report Error button. 4. Check your Honeybadger.js dashboard. The error should show up after a few seconds. diff --git a/packages/js/examples/chrome-extension/button.css b/packages/js/examples/chrome-extension/button.css index d6b39041..3ff2f74f 100644 --- a/packages/js/examples/chrome-extension/button.css +++ b/packages/js/examples/chrome-extension/button.css @@ -12,8 +12,3 @@ button.current { box-shadow: 0 0 0 2px white, 0 0 0 4px black; } - -button#throwError { - width: 60px; - height: 50px; -} diff --git a/packages/js/examples/chrome-extension/popup.html b/packages/js/examples/chrome-extension/popup.html index 5963ca7d..b25639ac 100644 --- a/packages/js/examples/chrome-extension/popup.html +++ b/packages/js/examples/chrome-extension/popup.html @@ -9,7 +9,7 @@

- + diff --git a/packages/js/examples/chrome-extension/popup.js b/packages/js/examples/chrome-extension/popup.js index 4584c76d..273a7832 100644 --- a/packages/js/examples/chrome-extension/popup.js +++ b/packages/js/examples/chrome-extension/popup.js @@ -24,8 +24,8 @@ function setPageBackgroundColor() { } // Button to throw an error and have it reported on Honeybadger -const throwError = document.getElementById('throwError'); -throwError.addEventListener('click', async () => { +const reportErrorButton = document.getElementById('reportErrorButton'); +reportErrorButton.addEventListener('click', async () => { // eslint-disable-next-line no-undef someUndefinedFunction(); });