Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Do not display popup icons when a popup is launched on page leave #3253

Merged
merged 1 commit into from
Apr 28, 2020

Conversation

MortimerGoro
Copy link
Contributor

Fixes #3250

I checked we match the Firefox Desktop behavior:

  • Open http://popuptest.com/popuptest2.html
  • Navigate to other place. Popup website triggers another popup on page leave.
  • The popup is rejected and the notification/icon are not visible in the awesome bar

@MortimerGoro MortimerGoro self-assigned this Apr 27, 2020
@bluemarvin bluemarvin added this to the #10 features milestone Apr 27, 2020
Copy link
Contributor

@bluemarvin bluemarvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to not work with the back button. STR:

  1. adb shell am start -a android.intent.action.VIEW -d http://www.popuptest.com/ org.mozilla.vrbrowser/.VRBrowserActivity
  2. Click on Come & Go Test
  3. Wait for page to be done
  4. Press back button

Actual:
Nav Bar show a popup was blocked

Expected:
Nav Bar should not show a popup was blocked.

@keianhzo
Copy link
Contributor

keianhzo commented Apr 28, 2020

@MortimerGoro It still happens whenever you navigate to another page in the same host probably because we are delaying the state updates.
We can probably remove the postDelayed code (I think we just inherited from the previous implementation) from here:

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

and that would fix it and we wouldn't need the host check.

@bluemarvin bluemarvin merged commit aa509ac into master Apr 28, 2020
@bluemarvin bluemarvin deleted the v10/leave_popup branch April 28, 2020 17:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The "Pop-UP Blocked" notification and icon are wrongly redisplayed on the next loaded website
3 participants