Skip to content

Commit

Permalink
Backed out 1 changesets (bug 1728669) for mochitest failures on test_…
Browse files Browse the repository at this point in the history
…ext_tabs_executeScript_good.html

Backed out changeset 35295637d5fd (bug 1728669)
  • Loading branch information
nbeleuzu committed Sep 1, 2021
1 parent 0abd78d commit 10c6832
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,15 @@ public GeckoResult<WebExtension> update(final @NonNull WebExtension extension) {
return;
}

extensionFromBundle(bundle).accept(extension -> {
final GeckoBundle senderBundle;
if ("GeckoView:WebExtension:Connect".equals(event) ||
"GeckoView:WebExtension:Message".equals(event)) {
senderBundle = bundle.getBundle("sender");
} else {
senderBundle = bundle;
}

extensionFromBundle(senderBundle).accept(extension -> {
if ("GeckoView:WebExtension:NewTab".equals(event)) {
newTab(message, extension);
return;
Expand Down Expand Up @@ -759,9 +767,6 @@ public GeckoResult<WebExtension> update(final @NonNull WebExtension extension) {
download(message, extension);
return;
}

// GeckoView:WebExtension:Connect and GeckoView:WebExtension:Message
// are handled below.
final String nativeApp = bundle.getString("nativeApp");
if (nativeApp == null) {
if (BuildConfig.DEBUG) {
Expand All @@ -771,7 +776,6 @@ public GeckoResult<WebExtension> update(final @NonNull WebExtension extension) {
return;
}

final GeckoBundle senderBundle = bundle.getBundle("sender");
final WebExtension.MessageSender sender = fromBundle(extension, senderBundle, session);
if (sender == null) {
if (callback != null) {
Expand Down
3 changes: 2 additions & 1 deletion mobile/android/modules/geckoview/GeckoViewWebExtension.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ class EmbedderPort {
class GeckoViewConnection {
constructor(sender, target, nativeApp, allowContentMessaging) {
this.sender = sender;
// Map from the extension MessageSender to the android GeckoBundle format.
sender.extensionId = sender.id;
this.target = target;
this.nativeApp = nativeApp;
this.allowContentMessaging = allowContentMessaging;
Expand Down Expand Up @@ -263,7 +265,6 @@ class GeckoViewConnection {
sender: this.sender,
data,
portId,
extensionId: this.sender.id,
nativeApp: this.nativeApp,
};

Expand Down

0 comments on commit 10c6832

Please sign in to comment.