Bug 1188543 - Part 1: Add TabSwitchComplete event. r=billm
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -3427,16 +3427,23 @@
startTabSwitch: function () {
TelemetryStopwatch.cancel("FX_TAB_SWITCH_TOTAL_E10S_MS", window);
TelemetryStopwatch.start("FX_TAB_SWITCH_TOTAL_E10S_MS", window);
this.addMarker("AsyncTabSwitch:Start");
},
finishTabSwitch: function () {
if (this.requestedTab && this.getTabState(this.requestedTab) == this.STATE_LOADED) {
+ // After this point the tab has switched from the content thread's point of view.
+ // The changes will be visible after the next refresh driver tick + composite.
+ let event = new CustomEvent("TabSwitched", {
+ bubbles: true,
+ cancelable: true
+ });
+ this.tabbrowser.dispatchEvent(event);
let time = TelemetryStopwatch.timeElapsed("FX_TAB_SWITCH_TOTAL_E10S_MS", window);
if (time != -1) {
TelemetryStopwatch.finish("FX_TAB_SWITCH_TOTAL_E10S_MS", window);
this.log("DEBUG: tab switch time = " + time);
this.addMarker("AsyncTabSwitch:Finish");
}
}
},