Closed Bug 1317067 Opened 9 years ago Closed 9 years ago

AMP pages broken when loading from Google

Categories

(Focus-iOS :: General, defect)

Other
iOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: malte.ubl, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2912.0 Safari/537.36 Steps to reproduce: This was observed with focus ad blocker, but may impact other disconnect based blockers. Filed https://github.com/ampproject/amphtml/issues/6163 for our investigation To reproduce: - Activate ad blocker - Search https://www.google.com for "obama" or "trump" - Find results marked as "AMP" - Try to load them - Loading Spinner is never removed. In general, AMP does not do any tracking itself (documents and most resources are served from a cookieless domain). It can instrument traditional tracking services, so things should just work if you block those. Expected results: Page should load.
I believe the problem is the way Focus builds the URL filtering regex from the disconnect's blacklist JSON, specifically this line: https://github.com/mozilla-mobile/focus/blob/67b4a95ef7da2dfd0bf259f8f1e33b50f1d05b09/build-disconnect.py#L14 This creates Swift regexes for blacklisted domains that incorrectly match AMP CDN URLs. For example, reddit's domain blacklist is: ^https?://(.+\\.)?reddit\\.com which will match "https://www.google.com/amp/s/amp.reddit.com/...". A fix could be to change the capturing group to exclude the '/' character, i.e. ^https?://([^/]+\\.)?reddit\\.com This ensures that the capturing group will only match subdomains of reddit.com (which I think is intended). I tested this change on a Swift sandbox and it appears to work -- I'll create a PR with this change. Please let me know if I've made a mistake somewhere.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
When can we expect this to roll out to users?
Right now :)
You need to log in before you can comment on or make changes to this bug.