let changeColor = document.getElementById('changeColor'); chrome.storage.sync.get('color', function(data) { changeColor.style.backgroundColor = data.color; changeColor.setAttribute('value', data.color); }); chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { console.log("test"); chrome.tabs.executeScript( tabs[0].id, {file: 'contentScript.js'}); });