diff --git a/src/mutation_events.js b/src/mutation_events.js index 13761b2..e534196 100644 --- a/src/mutation_events.js +++ b/src/mutation_events.js @@ -1,4 +1,4 @@ -// Copyright (c) 2023, Mason Freed +// Copyright (c) 2024, Mason Freed // All rights reserved. // // This source code is licensed under the BSD-style license found in the @@ -16,10 +16,6 @@ // https://github.com/mfreed7/mutation-events-polyfill#readme (function() { - // Check if Mutation Events are supported by the browser - if ("MutationEvent" in window) { - return; - } // Only run once if (window.mutationEventsPolyfillInstalled) { return; @@ -188,5 +184,5 @@ originalRemoveEventListener.apply(this, arguments); }; - console.log('Mutation Events polyfill installed.'); + console.log(`Mutation Events polyfill installed (native feature: ${("MutationEvent" in window) ? "supported" : "not present"}).`); })(); diff --git a/test/test.html b/test/test.html index d20ecec..cc72c97 100644 --- a/test/test.html +++ b/test/test.html @@ -6,25 +6,25 @@ const testEventOrder = false; // Set to true to test the order of events - -

Mutation Events Polyfill Test

-

Mutation Events are enabled in this browser. This test will - therefore only be testing the native implementation of Mutation - Events and not the polyfill.

-

In Chromium, the native behavior can be disabled via the flag - chrome://flags/#mutation-events. -

-
+ + +
+

Results:

+
+

Detailed event logs:

+ + +
CaseActual EventsExpected Events
+
+
-

Results:

-
-

Detailed event logs:

- - -
CaseActual EventsExpected Events