Page MenuHomePhabricator

Tapping on Download icon has no response in older versions of the Chrome browser including Samsung "Internet" browser.
Closed, ResolvedPublic3 Estimated Story Points

Assigned To
Authored By
Kaartic
Dec 5 2017, 4:52 AM
Referenced Files
F12945543: bs_realdroid_Mobile_Google Nexus 6-5.0-1440x2560 (1).jpg
Feb 1 2018, 10:16 PM
F12945544: bs_realdroid_Mobile_Google Nexus 6-6.0-1440x2560.jpg
Feb 1 2018, 10:16 PM
F12945545: bs_realdroid_Mobile_Samsung Galaxy Note 8-7.1-1440x2960.jpg
Feb 1 2018, 10:16 PM
F12829106: Screenshot_2018-01-27-07-17-50.png
Jan 27 2018, 6:04 PM
F12829126: Screenshot_2018-01-27-07-17-58.png
Jan 27 2018, 6:04 PM
F12665088: Screen Shot 2018-01-19 at 11.49.15 AM.png
Jan 19 2018, 7:57 PM
F12665085: Screen Shot 2018-01-19 at 11.50.08 AM.png
Jan 19 2018, 7:57 PM
F12665090: Screen Shot 2018-01-19 at 11.54.22 AM.png
Jan 19 2018, 7:57 PM
Tokens
"Baby Tequila" token, awarded by Liuxinyu970226."Baby Tequila" token, awarded by RandomDSdevel.

Description

It seems there is a new feature that allows users of Chrome mobile browser to save PDF versions of articles in the tap of a button. IIRC, it is currently only available for Google Chrome. The "Internet" browser shipped by Samsung on some Android devices seems to claim itself as Chrome in its user agent and the "Download" icon is shown on the articles loaded using that browser. The sad part of this is that for older versions of the browser, tapping on the "Download" button doesn't trigger the "Print" functionality. Instead it has no reaction, i.e. nothing happens.

Digging into this deeper, there seems to be a correlation with the button not working and older versions of Chrome.

Screen shot

Screenshot_2017-11-30-23-43-41.png (960×540 px, 144 KB)

Environment details
Browser name: Internet
Browser supplier: Samsung
Browser version: 3.5.38.174
Device model: Samsung Galaxy J2

NOTE: This is not an issue in newer versions of the browser such as 6.2.xxx
NOTE: Per T182207 This is also an issue in Chrome.

Acceptance criteria

  • We will disable the print button for Chrome browsers < version 41 by looking at the Chrome version number in the user agent.
  • We will also disable the print button for Android browsers where the version is less than 5.
  • for the user agent Mozilla/5.0 (Linux; Android 5.1.1; SAMSUNG SM-J200G Build/LMY47X) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.5 Chrome/38.0.2125.102 Mobile Safari/537.36 do not show a print button
  • for Mozilla/5.0 (Linux; Android 7.0; SAMSUNG SM-G950U1 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/6.2 Chrome/56.0.2924.87 Mobile Safari/537.36 a button is shown
  • For Mozilla/5.0 (Linux; Android 4.3; GT-I9300 Build/JSS15J) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36 a button is not shown (Android 4)
  • If the browser is Chrome and the version of Chrome is 36.0.1985.135 or less, a button is not shown.

Testing criteria

The change is live on the beta cluster.
Run through the acceptance criteria checklist and ensure the behaviour is as expected.

Sign off steps

Developer notes

Chrome version can be obtained like so:

var match = navigator.userAgent.match(/Chrome\/([0-9]*)/);
var version = match && match[1] ? parseInt( match[1], 10 ) : undefined;
match = ua.match(/android\s([0-9\.]*)/);
var androidVersion = match ? match[1] : false;
if ( version < 41  && androidVersion < 5) {
...
  • newer Samsung browsers using newer Chrome should show the print button, e.g. 7.1. We will assume they work until told otherwise.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Should we be mentioning about the issue that, download button in the older versions of chrome and browsers based on that might not work, in the upcoming Tech News? I guess it might be useful. The planned publication deadline for the upcoming edition seems to be Monday 18 December 2017.

Note: FWIW, I came to know about this initiative through TechNews.

Should we be mentioning about the issue that, download button in the older versions of chrome and browsers based on that might not work, in the upcoming Tech News? I guess it might be useful. The planned publication deadline for the upcoming edition seems to be Monday 18 December 2017.

Note: FWIW, I came to know about this initiative through TechNews.

@CKoerner_WMF - any thoughts on this?

I added a note to the next Tech News. However that will not be published until 9 January.

https://meta.wikimedia.org/w/index.php?title=Tech/News/2018/02&diff=17564281&oldid=17562524

I also added a note on the project talk page in case folks arrive there looking for more information.

https://www.mediawiki.org/wiki/Topic:U460nn09rhn4oaxy

I'll monitor the work and make sure update folks once we arrive at a solution.

@Ckoerner would be great if we could ask people with the same issue to let us know to collect more data!

Per T182197 this is ready for estimation/working on IMO.

Change 403968 had a related patch set uploaded (by Pmiazga; owner: Pmiazga):
[mediawiki/skins/MinervaNeue@master] Show Download button only on Android >= 5 & Chrome >= 41

https://gerrit.wikimedia.org/r/403968

Tested on Samsung S1, Samsung S2, Samsung S7, Samsung Note 10.1 and Samsung A5 on both Samsung Browser and Chrome, works as intended.

Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: pmiazga.

Change 403968 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Show Download button only on Android >= 5 & Chrome >= 41

https://gerrit.wikimedia.org/r/403968

I've tested on spoofed user agents and all looks good. The change should be live in about 30 mins or so on the beta cluster. Over to you @ABorbaWMF

Looks good to me so far. I have tried a bunch of devices. The icon is displaying and not displaying as expected. Some examples of older and newer chrome and firefox as well.

Screen Shot 2018-01-19 at 11.50.08 AM.png (1×618 px, 516 KB)

Screen Shot 2018-01-19 at 11.52.23 AM.png (1×680 px, 529 KB)

Screen Shot 2018-01-19 at 11.47.43 AM.png (1×654 px, 557 KB)

Screen Shot 2018-01-19 at 11.49.15 AM.png (1×590 px, 596 KB)

Screen Shot 2018-01-19 at 11.53.18 AM.png (1×610 px, 601 KB)

Screen Shot 2018-01-19 at 11.54.22 AM.png (1×618 px, 475 KB)

checking off acceptance criteria based on notes from @ABorbaWMF above.

ovasileva updated the task description. (Show Details)

seems good for now, resolving

The change should be live in about 30 mins or so on the beta cluster.

Should the behaviour of the download button in the beta cluster be in line with the behaviour of the download button in the production cluster? IOW, would the download button behave the same way in the production cluster after a few days as it currently behaves on the beta cluster?

I'm asking this because I am currently not seeing the spinning animation in the beta cluster when I tap on the download icon. This was on a Google Chrome running in a Android 5.1.1 device (Samsung Galaxy j2).

I'm asking this because I am currently not seeing the spinning animation in the beta cluster when I tap on the download icon.

Screen shot of a the Germany page before clicking on the download button:

Screenshot_2018-01-27-07-17-50.png (960×540 px, 164 KB)

Screen shot of a the Germany page after clicking on the download button before the Print Preview is shown:

Screenshot_2018-01-27-07-17-58.png (960×540 px, 163 KB)

I even recorded a screen cast but am not uploading it currently as phab doesn't seem to support mp4 files and I couldn't find a better place to upload it. Let me know if it's required. If possible, suggest a good site to host such media files (note: I don't have YouTube channel :) )

Looks like an unrelated regression caused by T182162
Nice spot!

Jdlrobson raised the priority of this task from Medium to High.Feb 1 2018, 6:09 PM

We need to get this fixed before next week's deploy. Let's make sure we also test for window.chrome

Dolphin: Mozilla/5.0 (Linux; Android 7.0; SM-G950U1 Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.98 Mobile Safari/537.36 no chrome

Opera: Mozilla/5.0 (Linux; Android 7.0; SM-G950U1 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.116 Mobile Safari/537.36 OPR/44.1.2246.123029

Maxthon
Mozilla/5.0 (Linux; Android 7.0; SM-G950U1 Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/63.0.3239.111 Mobile Safari/537.36 MxBrowser/4.5.10.1300

Change 407482 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/MinervaNeue@master] Disable download button on Chrome like browsers

https://gerrit.wikimedia.org/r/407482

Change 407482 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Disable download button on Chrome like browsers

https://gerrit.wikimedia.org/r/407482

Back to you Anthony. This should be fixed now.

Looks good. Resolving for now.

This comment was removed by Aklapper.
Anoop subscribed.

@Aklapper can you delete above two spam comments