Skip to content

Instantly share code, notes, and snippets.

@kaktumar
Last active August 29, 2015 14:18
Show Gist options
  • Save kaktumar/2ebbef4e6f8ddd33026f to your computer and use it in GitHub Desktop.
Save kaktumar/2ebbef4e6f8ddd33026f to your computer and use it in GitHub Desktop.
getFavicon(tab)
const tabToPromise = tab => {
let _then = favUrl => Promise.resolve(Object.defineProperty(tab,'favicon',{value:favUrl}));
return tab.favicon.then(_then,_then);
}
tabToPromise(tabData).then(bookmark =>
Request({
url: DBURL,
content: JSON.stringify(bookmark),
contentType: "application/json",
onComplete: response => {
if(response.status==201)
myButton.state(tab,{icon:ICONRED});
}
}).post()
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment