Skip to content

Commit

Permalink
guard Proxy and Reflect
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-atr committed Jan 18, 2023
1 parent 3d351b6 commit 65f1b08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scriptlets/inject-css-in-shadow-dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ import {
/* eslint-enable max-len */

export function injectCssInShadowDom(source, cssRule, hostSelector = '') {
// do nothing if browser does not support ShadowRoot
// do nothing if browser does not support ShadowRoot, Proxy or Reflect
// https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot
if (!Element.prototype.attachShadow) {
if (!Element.prototype.attachShadow || typeof Proxy === 'undefined' || typeof Reflect === 'undefined') {
return;
}

Expand Down

0 comments on commit 65f1b08

Please sign in to comment.