Skip to content

Commit

Permalink
try/catch to allow chef to run from prod file
Browse files Browse the repository at this point in the history
  • Loading branch information
d98762625 committed Feb 11, 2019
1 parent 2391e08 commit 710c9da
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/web/RecipeWaiter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -560,14 +560,20 @@ class RecipeWaiter {
this.ingredientRuleID = null;
this.ingredientChildRuleID = null;


// Find relevant rules in the stylesheet
for (const i in document.styleSheets[0].cssRules) {
if (document.styleSheets[0].cssRules[i].selectorText === ".ingredients") {
this.ingredientRuleID = i;
}
if (document.styleSheets[0].cssRules[i].selectorText === ".ingredients > div") {
this.ingredientChildRuleID = i;
// 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;
}
if (document.styleSheets[0].cssRules[i].selectorText === ".ingredients > div") {
this.ingredientChildRuleID = i;
}
}
} catch (e) {
// Do nothing.
}
}

Expand Down

0 comments on commit 710c9da

Please sign in to comment.