Skip to content

Commit

Permalink
Do not delay setting popupState (#3253)
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro committed Apr 28, 2020
1 parent 278920a commit aa509ac
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,11 @@ public GeckoResult<PromptResponse> onPopupPrompt(@NonNull GeckoSession geckoSess
final String uri = UrlUtils.getHost(session.getCurrentUri());
SitePermission site = mAllowedPopUpSites.stream().filter((item) -> item.url.equals(uri)).findFirst().orElse(null);
if (site != null) {
mAttachedWindow.postDelayed(() -> {
result.complete(popupPrompt.confirm(AllowOrDeny.ALLOW));
session.setPopUpState(SessionState.POPUP_ALLOWED);
}, 500);

result.complete(popupPrompt.confirm(AllowOrDeny.ALLOW));
session.setPopUpState(SessionState.POPUP_ALLOWED);
} else {
mAttachedWindow.postDelayed(() -> {
result.complete(popupPrompt.confirm(AllowOrDeny.DENY));
session.setPopUpState(SessionState.POPUP_BLOCKED);
}, 500);
result.complete(popupPrompt.confirm(AllowOrDeny.DENY));
session.setPopUpState(SessionState.POPUP_BLOCKED);
}

} else {
Expand Down

0 comments on commit aa509ac

Please sign in to comment.