title: chrome extension to record and play window events
body: <p><strong>Summary</strong></p>
  
  <p>I am looking for a Chrome extension that will give me JavaScript commands called something like "ListenForWindowEvent()" and "PlayWindowEvent()", which I can use to record raw window mouse and keyboard events, and replay them later. I don't want an extension that provides its own UI for recording and replaying sequences of events. I just want to be able to access (detect and play) such events from my own JavaScript code.</p>
  
  <p><strong>Details</strong></p>
  
  <p>Using JavaScript (with or without JQuery), I can track events (mousemove, mouseup, mousedown, click, keyup, keydown) almost anywhere on a page, and I can "replay" these events, mostly, by triggering the appropriate events (e.g., "click") on the appropriate elements.</p>
  
  <p>However, my understanding is that there are certain events that I can't quite detect or simulate, which all seem to have to do with "system level" components on a web page such as select (drop-down) menus, text input boxes, and scroll bars.</p>
  
  <p>For instance, I don't believe with just JavaScript that I can detect that the user dragged a scroll bar from position A to position B. I <em>can</em> listen for the scroll event after the fact, but can't detect the lower-level mouse events that caused the scroll. And even if I had these events, I couldn't replay them by causing the same click/drag events on the scroll bar. (I can only set the scroll value of the element.) Similarly, I can detect when a select menu changes value, but I don't have access to the mouse events that popped the menu open and then selected a particular item. For text input boxes, I believe I can see the individual key up and key down events, but I can't replay them into the box -- again I can only set the value of the text input element as a whole.</p>
  
  <p>Assuming all of that is more or less correct, what I want is a Chrome extension that would give me access to those low-level events (both monitoring them and replaying them) via JavaScript. I see that there are plenty of extensions that allow recording and replaying of these low-level events on the browser window. But these all seem to come with their own record/replay GUI. I don't want to use someone else's GUI. I just want to be able to record and replay these low-level window events myself via a simple extension that gives me JavaScript commands like "ListenForWindowEvent()" and "PlayWindowEvent()".</p>
  
  <p>I know that Puppeteer is Google's way of playing low-level events to a window. But if possible I'd like to avoid having to use a heavy solution like that (and I don't even know if Puppeteer can be used to record the events in the first place?). I imagine I can start with the source code of one of the standard record/replay automation extensions and make my own simpler extension. But I wanted to know if such an extension already exists. My Google searches only found the full-GUI ones.</p>