Opened 4 years ago

Last modified 3 years ago

#4034 new defect

Popup ads are closed too late

Reported by: mario Assignee:
Priority: P3 Milestone:
Module: Adblock-Browser-for-iOS Keywords: blocked
Cc: jand Blocked By:
Blocking: Platform: Adblock Browser for iOS
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description

Environment

ABB 1.3.2
iOS 9.3.1
iPhone 6

How to reproduce

  1. Open ABB and browse to thepiratebay.se
  2. Scroll to the bottom of the page and tap "Return to web version"
  3. In the main menu tap "Browse torrents"
  4. Tap the category "Audio"

Observed behaviour

A popup ad is triggered which is opened in a new tab and closed afterwards. ABB waits until the animation for opening a new tab is finished before closing the popup which distracts the user and interrupts their browsing experience for 1-2 seconds.

Expected behaviour

A popup ad is triggered which is immediately closed before triggering the animation for opening a new tab.

Change History (4)

comment:1 Changed 4 years ago by mario

  • Summary changed from Suppress ad popups before they're animated open to Suppress popup ads before they're animated in

comment:2 Changed 4 years ago by mario

  • Summary changed from Suppress popup ads before they're animated in to Popup ads are closed too late

comment:4 Changed 3 years ago by pavelz

  • Cc jand added
  • Keywords blocked added
  • Ready unset

We've got a conceptual issue with this. ABP popup checking logic is hooked on webNavigation.onCreatedNavigationTarget which in itself does not provide any resolution callback. The popup removal is performed through tabs.remove call in checkPotentialPopup. So we absolutely can apply a following order of handling:

  1. create the new tab data structure and assign it tabId, so that it's ready for onCreatedNavigationTarget inspection
  2. contrary to current state, do NOT launch UI animation to present the tab
  3. fire onCreatedNavigationTarget
  4. wait for tabs.remove and either delete the structure or go on with UI presentation

Unfortunately, the extension gives no trigger, no event for a positive feedback.
In other words, we don't know that the removal is not going to happen.

The only deterministic solution we've came up with is to hook on popupBlocker module from api.js. That would require code changes in popupBlocker because Object.observe is deprecated.

Non deterministic solution would be a timeout. If chrome.tabs.remove does not arrive in, say 0.3secs, we'll go on with the animation. That also means that ANY popup tab creation would be deferred by 0.3secs.

Speculations about how Chrome is possibly doing it are welcome.
@mario please CC a suitable coder and/or decision maker.
Meanwhile marking the issue as blocked and unreadying it.

Note: See TracTickets for help on using tickets.