Opened 18 months ago

Last modified 17 months ago

#3200 new defect

Element hiding not applied to page preloaded by Safari when typing URL

Reported by: arthur Assignee:
Priority: P2 Milestone:
Module: Platform Keywords:
Cc: mario, greiner, sebastian Blocked By:
Blocking: Platform: Safari
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by greiner)

Environment

  • Safari 9.0 (10601.1.56.2)
  • OS X Yosemite 10.10.5
  • MacBook Pro
  • Adblock Plus 1.9.3
  • EasyList Germany+EasyList

How to reproduce

  1. Add the custom filter ##body
  2. Open a new tab and navigate to a website
  3. Repeat the previous step
  4. Reload the last tab

Observed behaviour

Page body hidden in step 2 and step 4 but visible in step 3.

Expected behaviour

Page body should be hidden in steps 2 to 4.

Notes for testing

Make sure to use a different site on each try because as soon as a URL is entered once it will be remembered even after browser restarts.

Background

Safari preloads previously visited URLs when it is chosen as the top result on typing into the addressbar. Those page loads are not affected by our extension. Disabling "Preload Top Hit in the background" in Safari's preferences should fix this issue but we need to work around that in the extension.

Change History (8)

comment:1 Changed 18 months ago by sebastian

  • Cc greiner sebastian added
  • Owner sebastian deleted

I talked to greiner. He will look into this.

comment:2 Changed 18 months ago by greiner

  • Summary changed from Element hiding broken in Safari 9 to Element hiding not applied when switching of Acceptable Ads in Safari 9

I tried to reproduce it with the following setup:

Mac OSX 10.11 Beta
Safari 9.0
Adblock Plus 1.9.3
EasyList Germany+EasyList

There was no indication to me that element hiding wasn't working. What I can imagine is that Safari is heavily caching pages (even after a browser restart) which would explain why reloading the tab resolves the issue.

comment:3 Changed 18 months ago by greiner

  • Description modified (diff)
  • Summary changed from Element hiding not applied when switching of Acceptable Ads in Safari 9 to Element hiding not applied to page preloaded by Safari when typing URL

The issue appears to be caused by Safari preloading the URL that it suggests when typing in the addressbar. A confirmed workaround for this is unchecking "Preload Top Hit in the background" in the Safari preferences.

I updated the ticket accordingly.

comment:4 Changed 18 months ago by greiner

  • Component changed from Unknown to Platform

comment:5 Changed 18 months ago by sebastian

I still wonder why that is. Note that we already address preloaded tabs, by relying on content scripts rather than using the Windows and Tabs API on Safari. Might it be that there is a bug in Safari 9 that content scripts don't run in preloaded tabs anymore? OTherwise, could you spot any JavaScript error in the global page or content script?

comment:6 Changed 17 months ago by arthur

It seems this also causes the "Block element" menu to disappear.

comment:7 Changed 17 months ago by greiner

  • Description modified (diff)

comment:8 Changed 17 months ago by sebastian

  • Priority changed from Unknown to P2
  • Ready set
Note: See TracTickets for help on using tickets.