I am trying to retrieve an SVG image, store it locally, and use it later in the popup.js. The retrieval is done by a content script:
var svg = document.getElementById("svg");
chrome.storage.local.set({'svg': svg}, function() {
console.log(svg.localName === "svg"); //returns true
});
Unfortunately, the popup seems to get nothing but an empty object.
chrome.storage.local.get("svg", function(svg) {
console.log(svg.localName === "svg"); //returns false
});
I have little to no experience with Javascript and Chrome extensions, so I am probably doing something very stupid here.