Bug 1446913 beta-only workaround microtask on content clicking, r?kmag
Fixes TabOpen/TabMove event handling during content clicks.
MozReview-Commit-ID: EZMIJyjee0D
--- a/browser/modules/ContentClick.jsm
+++ b/browser/modules/ContentClick.jsm
@@ -15,17 +15,21 @@ ChromeUtils.defineModuleGetter(this, "Pl
ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
var ContentClick = {
// Listeners are added in nsBrowserGlue.js
receiveMessage(message) {
switch (message.name) {
case "Content:Click":
- this.contentAreaClick(message.json, message.target);
+ // Bug 1446913 - Ensure this happens in the next tick so TabOpen/TabMove
+ // events are processed correctly in webextensions.
+ Promise.resolve().then(() => {
+ this.contentAreaClick(message.json, message.target);
+ });
break;
}
},
/**
* Handles clicks in the content area.
*
* @param json {Object} JSON object that looks like an Event