/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
change(index) { if (index >= 0 && index < this.changes.length) { // Return a copy of the change at index. return Object.assign({}, this.changes[index]);
} // No change at that index -- return undefined. return undefined;
}
/** *Handlerfor"will-navigate"eventfromthebrowsingcontext.Theeventisfiredfor *thehostpageandanynestedresources,likeiframes.Thelistofchangesshouldbe *clearedonlywhenthehostpagenavigates,ignoringanyofitsiframes. * *TODO:Clearchangesmadewithinsourcesiniframeswhentheynavigate.Bug1513940 * *@param{object}eventData *Eventdatawiththeseproperties: *{ *window:Object// Window DOM object of the event source page *isTopLevel:Boolean// true if the host page will navigate *newURI:String// URI towards which the page will navigate *request:Object// Request data. *}
*/
onWillNavigate(eventData) { if (eventData.isTopLevel) { this.clearChanges();
}
}
pushChange(change) { this.changes.push(change); if (this._changesHaveBeenRequested) { this.emit("add-change", change);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.