I added an addEventListener to my window, but it is returning the following errors:
Uncaught TypeError: Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only 1 present. at
window.addEventListener('DOMContentLoaded', setUpStuff, false);
Another error:
Uncaught TypeError: Cannot read property 'addEventListener' of null (at:
optionsButton.addEventListener('click', function() {
Here is the code:
window.addEventListener('DOMContentLoaded', setUpStuff, false);
function setUpStuff(){
let optionsButton = document.getElementById('#go-to-options');
optionsButton.addEventListener('click', function() {
if (chrome.runtime.openOptionsPage) {
chrome.runtime.openOptionsPage();
} else {
window.open(chrome.runtime.getURL('options.html'));
}
});
}