Opened on 08/01/2016 at 08:59:47 AM

Last modified on 10/08/2019 at 05:49:12 PM

#4280 reopened defect

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

Reported by: scheer Assignee: arthur
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": [
				"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

  • The URL redirects to http://bs.serving-sys.com/BurstingPipe/AdServer.bs?cn=ccs&ebcmp=10430353&ebkw=249705620&advid=11899&ebag=9642384&sead=105349998804&ccsdev=c&ccsurl=$$https://www.nissan.co.uk/?&cid=psmh565SKgG_dc|U&cid=psmh565SKgG_dc|U$$ which is then blocked by the content blocking rule. Safari unhelpfully displays the wrong error message, stating that the URL can't be parsed!
  • A possible longer-term work around for this issue is #4327.

Attachments (2)

image1.PNG (76.0 KB) - added by scheer on 08/01/2016 at 09:00:05 AM.
Screen Shot 2016-08-01 at 10.30.54.png (50.8 KB) - added by kzar on 08/02/2016 at 12:52:57 PM.

Download all attachments as: .zip

Change History (52)

Changed on 08/01/2016 at 09:00:05 AM by scheer

comment:1 Changed on 08/01/2016 at 09:13:48 AM 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 on 08/01/2016 at 09:16:41 AM by scheer

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

comment:3 Changed on 08/01/2016 at 10:28:23 AM by scheer

  • Description modified (diff)

comment:4 Changed on 08/02/2016 at 11:12:33 AM 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 on 08/02/2016 at 11:18:40 AM by kzar

  • Description modified (diff)

comment:6 Changed on 08/02/2016 at 12:52:36 PM by kzar

  • Description modified (diff)

Changed on 08/02/2016 at 12:52:57 PM by kzar

comment:7 Changed on 08/02/2016 at 01:12:30 PM by kzar

  • Description modified (diff)
  • Keywords externaldependency added

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

comment:8 Changed on 08/02/2016 at 01:29:58 PM 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 on 08/02/2016 at 01:36:09 PM by kzar

  • Description modified (diff)

comment:10 Changed on 08/02/2016 at 01:41:55 PM by kzar

  • Description modified (diff)

comment:11 Changed on 08/02/2016 at 05:26:15 PM by kzar

  • Cc kzar added

comment:12 Changed on 08/08/2016 at 12:58:06 PM by mario

  • Keywords AcceptableAds added

comment:13 Changed on 08/12/2016 at 12:22:58 PM by sebastian

I filtered the list for any blocking rule whose regular expression matches this URL, and I found this one, which would essentially block that page. So it's probably not a Safari bug, though the error message is quite misleading.

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

Note that there is no distinction between frames and top-level documents with Content Blockers. Both are blocked by the "request-type": ["document"].

Last edited on 08/12/2016 at 12:29:14 PM by sebastian

comment:14 Changed on 08/12/2016 at 12:37:40 PM by kzar

I don't think that's the case, I can reproduce the problem without that rule. (See my notes in the Environment section about how I could reproduce this problem with only the ^https?://.*&advid= blocking rule.)

comment:15 Changed on 08/12/2016 at 03:08:54 PM by sebastian

The server returns a redirect to a URL like this, which is blocked by that rule:

http://bs.serving-sys.com/BurstingPipe/AdServer.bs?cn=ccs&ebcmp=10430353&ebkw=249705620&advid=11899&ebag=9642384&sead=105349998804&ccsdev=c&ccsurl=$$https://www.nissan.co.uk/?&cid=psmh565SKgG_dc|U&cid=psmh565SKgG_dc|U$$

comment:16 Changed on 08/12/2016 at 05:10:43 PM by kzar

  • Cc Ross scheer added
  • Description modified (diff)
  • Keywords externaldependency removed
  • Owner set to kzar
  • Review URL(s) modified (diff)

Yes, looks like you're right, remind me to completely ignore Safari's error messages in the future...

I've put a change under review to whitelist the domain for that example, but the same problem could still be present for other adverts.
Mario / Ross / Scott - could you guys do some further testing for me and see if you can find any other similarly broken ads? (Please paste the link's address for any that you find, rather than explaining how you performed the search.)

comment:17 Changed on 08/12/2016 at 05:12:00 PM by abpbot

A commit referencing this issue has landed:
Issue 4280 - Begin whitelisting domains used by Google redirects

comment:18 Changed on 08/13/2016 at 04:02:43 AM by abpbot

A commit referencing this issue has landed:
Issue 4280 - Whitelist further domains used by Google redirections

comment:19 Changed on 09/15/2016 at 08:25:52 AM by rraceanu

The issue also occurs on about.com when searching for Iphone 6s

Environment:
Iphone 6
iOS 9.1
ABP 1.1.0 (last update Thursday 15 September)

  1. Open about.com with Safari and ABP enabled
  2. Search for Iphoen 6 and open the link from m.base.de/iphone-6s

The link will open a new tab trying to redirect the user, but the page cannot be opened with the Error "The URL can't be shown". The link for that page is "googleadservices.com"

comment:20 Changed on 09/15/2016 at 08:39:37 AM by kzar

Please right click on the troublesome link, select "Copy Link" and paste that.

Unfortunately we're playing whack-a-mole with this issue for now. When one of these links are clicked the browser is redirected multiple times and if any of the redirected URLs are blocked this error shows. Worse still Safari displays the wrong URL when the error is shown, so without the original link we can't do anything!

Thanks for your help testing this.

(For reference #4327 is a possible longer-term solution to this problem.)

comment:22 Changed on 09/15/2016 at 08:54:57 AM by kzar

  • Description modified (diff)

comment:23 Changed on 09/21/2016 at 01:54:14 PM by arthur

  • Owner changed from kzar to arthur

comment:24 Changed on 09/23/2016 at 09:25:25 AM by arthur

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:25 Changed on 09/26/2016 at 10:54:21 AM by mario

  • Cc CraftyDeano added

comment:26 Changed on 09/27/2016 at 02:00:24 PM by abpbot

A commit referencing this issue has landed:
Issue 4280 - Whitelist further domains used by Google redirections

comment:27 Changed on 09/27/2016 at 02:01:42 PM by arthur

  • Status changed from reviewing to reopened

comment:28 Changed on 12/14/2016 at 12:32:31 PM by Bravy02

I still run into the same issue.
iOS 10.2 (iPad Air 2)
Adblock Plus 1.1.0

If I go to www.google.com in Safari and search for "Flatware" and then try to click one of the links near the top under "Shop For Flatware", I'm taken to the error "Safari cannot open the page. The error was: The URL was blocked by a content blocker".

The URL when the error is displayed is "https://www.google.com/aclk?sa=l&ai=DChcSEwiju-jM1_PQAhUDuMAKHUTYB9EYABAZ&sig=AOD64_1THDIeesXV1s1p1w6-6P0h1tICrQ&ctype=5&q=&ved=0ahUKEwjX0eHM1_PQAhWB54MKHS49DQkQwg8IHA&adurl="

I have tried whitelisting google.com and googleadservices.com in my Adblock Plus config but it did not help. Thank you.

comment:29 Changed on 01/05/2017 at 04:27:07 PM by arthur

  • Review URL(s) modified (diff)
  • Status changed from reopened to reviewing

comment:30 Changed on 01/05/2017 at 04:52:11 PM by abpbot

A commit referencing this issue has landed:
Issue 4280 - Include sub-domains for xg4ken.com click redirects

comment:31 Changed on 01/05/2017 at 04:53:46 PM by arthur

  • Status changed from reviewing to reopened

@Bravy02
Please try it with a manual filter update in ~20 minutes.

comment:32 Changed on 01/13/2017 at 12:37:02 PM by Bravy02

@arthur
I ran a manual filter update and still run into the same issue on my iPad Air 2 running iOS 10.2. I even removed "google.com" and "googleadservices.com" from the whitelist.

comment:33 follow-up: Changed on 01/13/2017 at 02:38:14 PM by arthur

Strange. Could you add the URL of the ad as you did last time?

comment:34 in reply to: ↑ 33 Changed on 01/27/2017 at 01:11:21 PM by Bravy02

Replying to arthur:

Strange. Could you add the URL of the ad as you did last time?

Sure thing. If you search www.google.com for "Flatware" and click on the first shopping picture for Walmart it's this URL which is still blocked by a content blocker.

https://www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwjHtufOsuLRAhUbVg0KHZBDAVwYABAY&ohost=www.google.com&cid=CAESIuD2pjpXqclT2dlEoCZ5T84d_zE2rYGvRimS6IjhMwI9f6w&sig=AOD64_2l17LGUea1F_qG9IrjmN1jAdxdMw&ctype=5&q=&ved=0ahUKEwjWvOPOsuLRAhVIzIMKHZfFCc0Qwg8IHA&adurl=

Note that if I manually remove "&adurl=" from the end of that URL, this URL works in Safari on my iPad (iOS 10.2.1) with the latest filter list:

https://www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwjHtufOsuLRAhUbVg0KHZBDAVwYABAY&ohost=www.google.com&cid=CAESIuD2pjpXqclT2dlEoCZ5T84d_zE2rYGvRimS6IjhMwI9f6w&sig=AOD64_2l17LGUea1F_qG9IrjmN1jAdxdMw&ctype=5&q=&ved=0ahUKEwjWvOPOsuLRAhVIzIMKHZfFCc0Qwg8IHA

Last edited on 01/27/2017 at 01:14:26 PM by Bravy02

comment:35 follow-up: Changed on 02/08/2017 at 03:01:31 PM by arthur

Sorry for my late reply!

Thanks! I tried to reproduce this on a Mac Mini and iPad Air 2 but couldn't. The links from you work fine and I also tried it with some Walmart ads when searching for "flatware".

Maybe you could try it again after clearing cache and cookies in Safari and re-installing Adblock Plus?

comment:36 in reply to: ↑ 35 Changed on 02/12/2017 at 06:22:20 PM by Bravy02

Replying to arthur:

Sorry for my late reply!

Thanks! I tried to reproduce this on a Mac Mini and iPad Air 2 but couldn't. The links from you work fine and I also tried it with some Walmart ads when searching for "flatware".

Maybe you could try it again after clearing cache and cookies in Safari and re-installing Adblock Plus?

No worries, thank you for your help!

Actually I just updated the filter list again (it was last updated 1/27/17) and then disabled/re-enabled AdBlock Plus in the iOS Safari Content Blocker settings and now the Google Shopping Ad URLs are no longer blocked. I also tried the Google Ad URL for Walmart flatware that I previously posted and it works now too!

Let's close this out, thank you again.

comment:37 Changed on 02/13/2017 at 10:27:53 AM by arthur

Thanks for confirming!

comment:38 Changed on 06/07/2017 at 06:16:07 AM by abpbot

A commit referencing this issue has landed:
Issue 4280 - Whitelist further domains used by Google redirections

comment:40 Changed on 07/04/2017 at 03:13:48 PM by arthur

I wasn't able to reproduce this (iPhone 6S, iOS 9.2.1, ABP 1.1.0). I updated the filters and cleared the browsing history in Safari before testing. Could you do the same and tell me if it's still happening then?

Does it happen as well if you open https://issues.adblockplus.org/ticket/4280 in Safari and go to the last link you posted?

comment:41 Changed on 07/09/2017 at 10:52:32 PM by Bravy02

I am using iOS 10.3.2 on my iPhone 6 and iPad Air 2 with ABP 1.1.0. I went into the Safari Content Blocker settings and disabled Adblock Plus and then re-enabled it. Then I tried the links in my previous post and they are working now. I'm not sure when the issue started, perhaps it was either the update from iOS 10.2.x to 10.3 or one of the 10.3 updates.

comment:42 Changed on 07/14/2017 at 12:21:22 PM by Bravy02

This is still an issue on my iPad Air 2 and iPhone 6 running iOS 10.3.2. I have cleared all cookies and browsing history and the links in the Google Search results for shopping are being blocked if you try to click on them. If you tap and hold to open the link in a new tab, it is not blocked.

comment:43 Changed on 07/14/2017 at 12:43:30 PM by arthur

Please always include the blocked destination URL when this issue occurs.

comment:45 Changed on 07/31/2017 at 01:19:53 PM by arthur

I tried it and it's working fine for me. I was only able to reproduce it when disabling Acceptable Ads. Could you check if whether it's enabled for you?

comment:46 Changed on 08/30/2017 at 12:56:52 PM by arthur

  • Cc amrmak added

comment:47 Changed on 10/03/2017 at 01:24:38 AM by Bravy02

I thought I replied to this a month or so ago, my apologies. I had Acceptable Ads disabled on both devices. I enabled Acceptable Ads and then the Google Shopping links started working. I left Acceptable Ads enabled which solves my concern.

comment:48 Changed on 07/26/2019 at 06:08:52 AM by PlasticSurgeonInLahore

spam

Last edited on 10/08/2019 at 05:49:05 PM by kzar

comment:49 Changed on 09/24/2019 at 02:59:41 PM by slotslotonline

spam

Last edited on 10/08/2019 at 05:49:09 PM by kzar

comment:50 Changed on 09/25/2019 at 09:05:44 AM by nps1337

spam

Last edited on 10/08/2019 at 05:49:12 PM by kzar

Add Comment

Modify Ticket

Change Properties
Action
as reopened .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from arthur.
Next status will be 'reviewing'.
 
Note: See TracTickets for help on using tickets.