|
@@ -561,13 +561,18 @@ class RecipeWaiter {
|
|
|
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.
|
|
|
}
|
|
|
}
|
|
|
|