MCPcopy Create free account
hub / github.com/ampproject/amphtml / dispatchVisibilityChangeEvent_

Method dispatchVisibilityChangeEvent_

3p/ampcontext.js:145–150  ·  view source on GitHub ↗

* TODO(alanorozco): Deprecate native event mechanism. * @private

()

Source from the content-addressed store, hash-verified

143 * @private
144 */
145 dispatchVisibilityChangeEvent_() {
146 const event = this.win_.document.createEvent('Event');
147 event.data = {hidden: this.hidden};
148 event.initEvent(AmpEvents_Enum.VISIBILITY_CHANGE, true, true);
149 this.win_.dispatchEvent(event);
150 }
151
152 /**
153 * Listen to page visibility changes.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected