Content scripts have direct access to the localStorage page.
If you want to save the value for a specific domain, simply open a window or frame, and then write to the local storage of the window / page.
. API tabs, chrome.tabs.executeScript. , , , .
chrome.tabs.create({
active: false,
url: 'http://stackoveflow.com/robots.txt'
}, function(tab) {
chrome.tabs.executeScript(tab.id, {
code: 'localStorage.setItem("key", "value");'
}, function() {
chrome.tabs.remove(tab.id);
});
});