try/catch to allow chef to run from prod file

master
d98762625 2019-02-11 16:46:54 +00:00
parent 2391e08ac1
commit c01c076561
1 changed files with 11 additions and 6 deletions

View File

@ -561,6 +561,8 @@ class RecipeWaiter {
this.ingredientChildRuleID = null;
// Find relevant rules in the stylesheet
// try/catch for chrome 64+ CORS error on cssRules.
try {
for (const i in document.styleSheets[0].cssRules) {
if (document.styleSheets[0].cssRules[i].selectorText === ".ingredients") {
this.ingredientRuleID = i;
@ -569,6 +571,9 @@ class RecipeWaiter {
this.ingredientChildRuleID = i;
}
}
} catch (e) {
// Do nothing.
}
}
if (!this.ingredientRuleID || !this.ingredientChildRuleID) return;