Skip to content

Instantly share code, notes, and snippets.

@gabericharde
Created September 13, 2016 14:36
Show Gist options
  • Save gabericharde/ea5831969567ee754e925dfc4b8b3d67 to your computer and use it in GitHub Desktop.
Save gabericharde/ea5831969567ee754e925dfc4b8b3d67 to your computer and use it in GitHub Desktop.
var bubble = {
"date": Date(),
"title": document.title,
"url": window.location.toString(),
"domain": window.location.hostname,
"meta": [document.querySelector("meta[property='og:type']"), document.querySelector("meta[property='og:description']")]
};
// so we can interact with bubble object in inspector
window.bubble = bubble;
if (bubble.meta[0].content == undefined) {
bubble.meta[0].content = "misc";
chrome.storage.local.set({'value': bubble}, function() {
// Notify that we saved.
console.log(bubble);
});
}
else {
console.log(bubble.meta[0]);
chrome.storage.local.set({'value': bubble}, function() {
// Notify that we saved.
console.log(bubble);
});
};
/* CODE SNIPPET FROM MARC
for (key in localStorage) {
console.log(key, localStorage.getItem(key));
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment