Last active
August 29, 2015 14:18
-
-
Save kaktumar/2ebbef4e6f8ddd33026f to your computer and use it in GitHub Desktop.
getFavicon(tab)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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