@appsurify-testmap/rrdom-nodejs 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.
@@ -31,6 +31,30 @@ const interactiveEvents = [
31
31
  "touchend",
32
32
  "touchcancel"
33
33
  ];
34
+ const inlineEventAttributes = [
35
+ "onclick",
36
+ "ondblclick",
37
+ "onmousedown",
38
+ "onmouseup",
39
+ "onmouseover",
40
+ "onmouseout",
41
+ "onmousemove",
42
+ "onfocus",
43
+ "onblur",
44
+ "onkeydown",
45
+ "onkeypress",
46
+ "onkeyup",
47
+ "onchange",
48
+ "oninput",
49
+ "onsubmit",
50
+ "onreset",
51
+ "onselect",
52
+ "oncontextmenu",
53
+ "ontouchstart",
54
+ "ontouchmove",
55
+ "ontouchend",
56
+ "ontouchcancel"
57
+ ];
34
58
  const interactiveElementsRegistry = /* @__PURE__ */ new WeakSet();
35
59
  const originalAddEventListener = EventTarget.prototype.addEventListener;
36
60
  EventTarget.prototype.addEventListener = function(type, listener, options) {
@@ -46,6 +70,21 @@ const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
46
70
  EventTarget.prototype.removeEventListener = function(type, listener, options) {
47
71
  originalRemoveEventListener.call(this, type, listener, options);
48
72
  };
73
+ function inspectInlineEventHandlers() {
74
+ const allElements = document.querySelectorAll("*");
75
+ allElements.forEach((el) => {
76
+ inlineEventAttributes.forEach((attr) => {
77
+ if (el.hasAttribute(attr)) {
78
+ interactiveElementsRegistry.add(el);
79
+ }
80
+ });
81
+ });
82
+ }
83
+ if (document.readyState === "complete" || document.readyState === "interactive") {
84
+ inspectInlineEventHandlers();
85
+ } else {
86
+ document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers);
87
+ }
49
88
  function getDefaultExportFromCjs(x2) {
50
89
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
51
90
  }