uBlockOrigin / uAssets

Resources for uBlock Origin, uMatrix: static filter lists, ready-to-use rulesets, etc.
GNU General Public License v3.0
4.04k stars 759 forks source link

British Airways check-in screen broken #405

Closed elad closed 7 years ago

elad commented 7 years ago

URL(s) where the issue occurs

https://checkin.ba.com/travel/checkin/public/en_il

(I don't know how useful this URL will be without a ticket.)

Describe the issue

British Airways check-in screen is broken since an important check box isn't displayed.

Screenshot(s)

This has been widely reported and is the first example in this slide deck: https://oriel.io/blog/adblocking-blocking-more-than-ads/

Here's the portion of the screen that gets blocked:

screen shot 2017-05-17 at 9 56 04

Here's what "inspect element" shows:

screen shot 2017-05-17 at 9 56 43

Versions

Settings

Default

Notes

I'll happily investigate and submit PRs if I only knew where to begin. How do I go about figuring out which list/filter blocks an element?

gorhill commented 7 years ago

How do I go about figuring out which list/filter blocks an element?

Logger.

elad commented 7 years ago

Awesome, thanks! Please keep this issue open -- I'll try and close it on the way back. :)

In the meantime, I grepped through the assets directory and looked for things that might be relevant (by domain, class, and id). I could only find these:

$ grep -nri britishair 1.12.1_0/assets/
1.12.1_0/assets//thirdparties/easylist-downloads.adblockplus.org/easylist.txt:56852:@@||britishairways.com/cms/global/styles/*/openx.css
1.12.1_0/assets//thirdparties/easylist-downloads.adblockplus.org/easyprivacy.txt:11974:@@||britishairways.com/cms/global/scripts/applications/tracking/visualsciences.js
$ 

I'll follow up once I have more data.

gorhill commented 7 years ago

@@||britishairways.com/cms/global/styles/*/openx.css @@||britishairways.com/cms/global/scripts/applications/tracking/visualsciences.js

These are exception filters, meant to prevent some other block filters from being enforced.

Things to quickly try when the issue occurs, to possibly narrow:

elad commented 7 years ago

Forgot to update this issue. When I tried again, for some reason I could not reproduce the issue. I tried several times and made sure no exception rules existed, but it did not happen again. What's the policy in such a case? Shall I leave it open, or close and reopen if I come across it again somehow?

gorhill commented 7 years ago

If you can't reproduce, the issue should be closed, and re-open if ever it comes back.

mikelward commented 7 years ago

Happened to me today. Logger didn't show any logs. Badge suggested one or two elements were blocked, page/settings settings showed a 1 on cosmetic filtering. Can't debug further since I've now checked in to my flight.

elad commented 7 years ago

Did you start the logger before or after the issue manifested? I think it only shows logs of events that happened after it was started (but I could be wrong).

gorhill commented 7 years ago

The browser console may also provide hints, there could be a javascript exception reported in there, and it might be possible to get an idea of where to look when taking into account what was blocked (also reported in the browser console).

mikelward commented 7 years ago

After, unfortunately. It's clear now I needed to start logger and retry, but at the time I was focused on getting good seats. Got the last two. :(

Is elad's screenshot of the DOM and my belief that it's due to cosmetic filtering sufficient to investigate further? Obviously reproduction will be hard.

As I'm traveling, I also already shut my laptop down, so I'm afraid I can't check console logs.

gorhill commented 7 years ago

I don't see anything in the DOM screenshot which suggests it is a cosmetic filtering issue. That would be easy to find out, just turn off cosmetic filtering for that site and see if the issue ever happens again.

mikelward commented 7 years ago

Step 1: buy a British Airways ticket Step 2: wait until 24 hours until the flight Step 3: go to the check in page Step 4: enable logger Step 5: try to check in

I'm currently stuck at step 1. ;)

elad commented 7 years ago

I was thinking that maybe there's room to add a feature that would aid debugging this kind of bugs (where reproduction is difficult) but also make it easier to report things.

Consider an always-enabled log that only stores the most recent 100 log lines or so (ring buffer). Then if a problem occurs, all the user has to do is immediately click a button (the uBlock Origin menu button) and get the log copied to the clipboard. From there it's easy to paste it in an issue, not before one removes any potentially private and/or identifying lines.

I'm willing to dig in and figure out how to do this, if it sounds like something that is desirable. :)

gorhill commented 7 years ago

if it sounds like something that is desirable

No. The issue is not the ring bugger size, it could be just one entry, and yet uBO would have to collect all needed information for logging purpose for every single network request, which is a non-trivial overhead to be paid all the time. That we have one difficult case of false positive is no ground to debase uBO's efficiency.

Also: https://forums.lanik.us/viewtopic.php?f=64&t=36015.

The key to solve this one false positive is just collaboration by whoever is in a position at some point to reproduce.

elad commented 7 years ago

I had no idea the overhead was non-trivial, got it.

mikelward commented 7 years ago

Trying to change my seats, I get the same error @gorhill links to above. (Console log snippet below.)

Sounds like the site has been aware of this issue for over 12 months, and probably for more than 3 years.

http://www.telegraph.co.uk/technology/2016/04/19/ad-blockers-are-breaking-the-internet-study-finds/ https://twitter.com/bernardtyers/status/399909803293569027

Is there any way to show a warning to the user or make it clear that this web site is incompatible with ad blockers?

visualsciences.js Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
mmapi.js Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
modernizr-2.6.2.min.js:4 document.body doesn't exist. Modernizr hyphens test needs it.
(anonymous) @ modernizr-2.6.2.min.js:4
di.js Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
global_vsg.js:2407 Uncaught ReferenceError: vsDoTracking is not defined
    at HTMLDocument.<anonymous> (global_vsg.js:2407)
    at l (jquery-1.8.3.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-1.8.3.min.js:2)
    at Function.ready (jquery-1.8.3.min.js:2)
    at HTMLDocument.A (jquery-1.8.3.min.js:2)
doc_man.js:189 Uncaught ReferenceError: vsDoTracking is not defined
    at pageload (doc_man.js:189)
    at onload (en_gb?eId=173006&journeyID=1&sectorID=2&source=COS:56)
gorhill commented 7 years ago

There is this exception filter in EasyPrivacy:

@@||britishairways.com/cms/global/scripts/applications/tracking/visualsciences.js

However the original report here says the error occurred on https://checkin.ba.com/travel/checkin/public/en_il, and in that case the visualsciences.js script is loaded from https://checkin.ba.com/cms/global/scripts/applications/tracking/visualsciences.js, which means it's not hit by the exception filter.

So I will add @@||ba.com/cms/global/scripts/applications/tracking/visualsciences.js, there is a good chance this will fix the issue.

mikelward commented 7 years ago

Thank you so much for the speedy response!

elad commented 7 years ago

@mikelward feel like changing your seats again? ;)

mikelward commented 7 years ago

It worked! Thanks!

I'm a little confused how, since I don't see the rule @gorhill mentioned in any of the 3rd-party filters in settings. Is that just the bootstrap list and there's some dynamic update capability too? Or is there a different rule that's doing it? (How would I tell?)

gorhill commented 7 years ago

There could also have been a timing issue, there have been cases where blocking something sometimes break a page, sometimes it does not: it sometimes depends when the javascript exception is fired. If a javascript exception occurs before critical code is executed elsewhere, the page breaks, otherwise it doesn't. An example: #437.

gorhill commented 7 years ago

The filter list to update is "uBlock filters -- Unbreak".