Opened 3 years ago

Last modified 5 weeks ago

#4280 reopened defect

Safari "page's address isn't valid" error when using the content blocking API — at Version 9

Reported by: scheer Assignee:
Priority: P1 Milestone:
Module: Adblock-Plus-for-iOS/macOS Keywords: AcceptableAds
Cc: mario, kzar, Ross, scheer, CraftyDeano, amrmak Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29349794/
https://codereview.adblockplus.org/29354751/
https://codereview.adblockplus.org/29370756/

Description (last modified by kzar)

Environment

iPhone 6s Plus
iOS 9.3.1
ABP iOS 1.1.0

OR

Safari 9.1 for Mac OS X
An otherwise empty extension that uses this Content Blocker File:

[
	{
		"trigger": {
			"url-filter": "^https?://.*&advid=",
			"resource-type": [
				"image",
				"style-sheet",
				"script",
				"font",
				"media",
				"raw",
				"document"
			]
		},
		"action": {
			"type": "block"
		}
	}
]

How to reproduce

  1. Visit https://www.google.co.uk/aclk?sa=L&ai=DChcSEwjC6rqt5p_OAhVGuBsKHUoeAG8YABAA&sig=AOD64_2kAoVInCmwfi5kot9P5h-jb1GQ7Q&q=&ved=0ahUKEwjA-bet5p_OAhVlBcAKHVU4CDMQ0QwIIQ&adurl=

OR

  1. Visit https://www.google.de and search 'Samsung Galaxy S7'
  2. Select the Ad with the URL 'www.base.de/galaxy-s7'

OR

  1. Visit https://au.search.yahoo.com and search 'buy car'
  2. Select the ad 'www.AMSVans.com'

Observed behaviour

On iOS this error message is displayed: Safari cannot open the page 'The Error was. 'The URL can't be shown'.

For Safari 9.1 on Mac OS X this message is displayed: "Safari can't open the page "​https://www.google.co.uk/aclick?..." because the page's address isn't valid".

Expected behaviour

No error message displayed, browser is redirected to the advertisement.

Notes

  • Safari 9.1 considers the URL invalid both before and after the recent #3050 hotfix to the blocking rules.
  • Safari 9.1 does not consider the URL invalid when no content blocking extension is installed.
  • Safari 9.1 does not consider the URL invalid when a content blocking extension with other rules is installed.
  • This appears to be a Safari bug related to the content blocking API.
  • While the bug can be triggered with a content blocker file with only one rule, the problem is not resolved by removing that rule from easylist+exceptionrules_content_blocker.json. (In other words the problem can be triggered by multiple rules in our file. I haven't found a pattern yet however.)
  • I have filed bug 27656882 with bugreport.apple.com.

Change History (11)

Changed 3 years ago by scheer

comment:1 Changed 3 years ago by scheer

Whilst testing, I also used the same search criteria on www.yahoo.co.uk for 'buy car'. When selecting the ad link for www.nissan.co.uk/car, the advertised URL loads correctly.

comment:2 Changed 3 years ago by scheer

bing.com also works correctly with the above mentioned URL's.

comment:3 Changed 3 years ago by scheer

  • Description modified (diff)

comment:4 Changed 3 years ago by kzar

  • Cc mario added
  • Description modified (diff)
  • Owner set to kzar
  • Platform changed from iOS to Unknown / Cross platform
  • Priority changed from Unknown to P1
  • Ready set
  • Summary changed from 'URL can't be shown' when selecting a particular ad-link from Google search results in ABP iOS to Safari "page's address isn't valid" error when using the content blocking API

This looks like it could be a Safari bug, but before we continue I want to try to figure out which rules trigger the problem.

comment:5 Changed 3 years ago by kzar

  • Description modified (diff)

comment:6 Changed 3 years ago by kzar

  • Description modified (diff)

Changed 3 years ago by kzar

comment:7 Changed 3 years ago by kzar

  • Description modified (diff)
  • Keywords externaldependency added

I have filed a bug with Apple about this, bug number is 27656882.

comment:8 Changed 3 years ago by kzar

  • Owner kzar deleted

I haven't managed to find a quick work around for this problem, I'm not sure what we can do at this point. I've tried removing all rules with filters containing .*&ad but that didn't help. To work around this our end we would likely have to remove huge portions of the rule list, and good luck finding the exact combination of the ~50,000 rules that works!

Apple are hardly responsive to bug reports. Perhaps we could instead work with Google to help them avoid using URLs that trigger the bug?

comment:9 Changed 3 years ago by kzar

  • Description modified (diff)
Note: See TracTickets for help on using tickets.