Skip to content

Commit

Permalink
Fix supported message
Browse files Browse the repository at this point in the history
  • Loading branch information
mfreed7 committed Aug 7, 2024
1 parent 5d59b6a commit f249c93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/mutation_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
}
window.mutationEventsPolyfillInstalled = true;
// If the feature is already natively supported, use it instead.
if ("MutationEvent" in window && !window.mutationEventsUsePolyfillAlways) {
const nativeFeatureSupported = "MutationEvent" in window;
if (nativeFeatureSupported && !window.mutationEventsUsePolyfillAlways) {
return;
}

Expand Down Expand Up @@ -212,5 +213,5 @@
return originalCreateEvent.call(this,type,...args);
};

console.log(`Mutation Events polyfill installed (native feature: ${("MutationEvent" in window) ? "supported" : "not present"}).`);
console.log(`Mutation Events polyfill installed (native feature: ${nativeFeatureSupported ? "supported" : "not present"}).`);
})();
2 changes: 1 addition & 1 deletion src/mutation_events.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f249c93

Please sign in to comment.