I have been struggling with following issue for a couple of days:
I would like to write to the local storage of the parent tab instead of the popup.
I tried many different approaches found on internet but when it comes to writing to the local storage value is always set to the local storage of the popup and not the parent tab.
Here is my (bad) piece of code:
document.addEventListener('DOMContentLoaded', function () {
var checkPageButton = document.getElementById('clickIt')
checkPageButton.addEventListener('click', function () {
chrome.tabs.query({ windowId: chrome.windows.WINDOW_ID_CURRENT},
function (tabs) {
localStorage.setItem('bgcolor', 'red');
})
})
})
I am very new to all this and above example is just the latest of so many things I tried.
Thanks a lot in advance for your help!