@appsurify-testmap/rrdom 2.0.0-alpha.40 → 2.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/rrdom.cjs CHANGED
@@ -89,6 +89,30 @@ const interactiveEvents = [
89
89
  "touchend",
90
90
  "touchcancel"
91
91
  ];
92
+ const inlineEventAttributes = [
93
+ "onclick",
94
+ "ondblclick",
95
+ "onmousedown",
96
+ "onmouseup",
97
+ "onmouseover",
98
+ "onmouseout",
99
+ "onmousemove",
100
+ "onfocus",
101
+ "onblur",
102
+ "onkeydown",
103
+ "onkeypress",
104
+ "onkeyup",
105
+ "onchange",
106
+ "oninput",
107
+ "onsubmit",
108
+ "onreset",
109
+ "onselect",
110
+ "oncontextmenu",
111
+ "ontouchstart",
112
+ "ontouchmove",
113
+ "ontouchend",
114
+ "ontouchcancel"
115
+ ];
92
116
  const interactiveElementsRegistry = /* @__PURE__ */ new WeakSet();
93
117
  const originalAddEventListener = EventTarget.prototype.addEventListener;
94
118
  EventTarget.prototype.addEventListener = function(type, listener, options) {
@@ -104,6 +128,21 @@ const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
104
128
  EventTarget.prototype.removeEventListener = function(type, listener, options) {
105
129
  originalRemoveEventListener.call(this, type, listener, options);
106
130
  };
131
+ function inspectInlineEventHandlers() {
132
+ const allElements = document.querySelectorAll("*");
133
+ allElements.forEach((el) => {
134
+ inlineEventAttributes.forEach((attr) => {
135
+ if (el.hasAttribute(attr)) {
136
+ interactiveElementsRegistry.add(el);
137
+ }
138
+ });
139
+ });
140
+ }
141
+ if (document.readyState === "complete" || document.readyState === "interactive") {
142
+ inspectInlineEventHandlers();
143
+ } else {
144
+ document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers);
145
+ }
107
146
  function getDefaultExportFromCjs(x2) {
108
147
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
109
148
  }