A window for a given document can be obtained using the document.defaultView property. How to set a click event once a page or view is loaded in vue.js? Let's say we gather data about how the page is used: mouse clicks, scrolls, viewed page areas, and so on. Acidity of alcohols and basicity of amines, Partner is not responding when their writing is needed in European project application. The load event also fires on images. When the sendBeacon request is finished, the browser probably has already left the document, so theres no way to get server response (which is usually empty for analytics). To catch load events on the window, that load event must be dispatched directly to the window. For instance, if the page has a form with login and password, and the browser remembered the values, then on DOMContentLoaded it may try to autofill them (if approved by the user). When the browser processes an HTML-document and comes across a