It creates a browser action that throws an exception captured by Rollbar
- Go to extensions
- Enable developer mode
- Load this extensions from a folder
// Called when the user clicks on the browser action icon. | |
chrome.browserAction.onClicked.addListener(function(tab) { | |
chrome.tabs.executeScript(null, {file: "content_script.js"}); | |
}); |
;(function() { | |
const script = document.createElement('script') | |
script.src = chrome.extension.getURL('inject.js') | |
document.documentElement.appendChild(script) | |
})() |
throw new Error('Extension error') |
{ | |
"name": "Throw error", | |
"description": "This extension throws exception handled by Rollbar.", | |
"version": "1.0.0", | |
"background": { | |
"scripts": ["background.js"], | |
"persistent": false | |
}, | |
"permissions": [ | |
"tabs", "http://*/*", "https://*/*" | |
], | |
"browser_action": { | |
"default_title": "Throw extension error" | |
}, | |
"web_accessible_resources": [ | |
"inject.js" | |
], | |
"manifest_version": 2 | |
} |