Created
December 11, 2017 23:49
-
-
Save bjvoth/875a9476c596d4b9a715ea2fe7c5c8c2 to your computer and use it in GitHub Desktop.
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
function process(tab) { | |
// dont need this try, as you aren't trying anything that will fail | |
// try { | |
console.log("process: ", tab.url) | |
if (tab.url.match(/^https?:\/\/([^/]+\.)?facebook.com\//)) { | |
console.log('url matches facebook') | |
// dont need this try - it will never execute catch (if statement will fall | |
// through to else before `catching` an error | |
// try { | |
if(!(tab.id in delayments) || delayments[tab.id] < (new Date()).getTime()) { | |
try { | |
// this line is the first one that could potentially fail | |
contentProps(tab.id,{ state: 'modal' }) | |
} catch(e) { console.log(e) } | |
} | |
else { | |
console.log('Bar'); | |
} | |
} | |
// catch(e) { | |
console.error(e); | |
} | |
} else { | |
console.log('Baz'); | |
// contentProps(tab.id,{ state: 'hidden' }); | |
} | |
// } catch(e) { | |
// console.error(e); | |
// } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment