Last modified: 2014-03-31 21:15:36 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T64540, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 62540 - Media Viewer: Possible to bypass the Media Viewer and go to file description page if page is not fully loaded
Media Viewer: Possible to bypass the Media Viewer and go to file description ...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
MultimediaViewer (Other open bugs)
unspecified
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-11 17:29 UTC by Dan Garry
Modified: 2014-03-31 21:15 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Dan Garry 2014-03-11 17:29:19 UTC
If a page has a lot of content on it, you will sometimes be taken to the file description page for an image instead of the Media Viewer.

Workflow to reproduce:
1) Go to https://commons.wikimedia.org/wiki/User:Fabrice_Florin_(WMF)/gallery
2) Scroll down and click on the first image while the page is still loading

You will be taken to the description page for the image instead of the Media Viewer. 

I would guess this problem is being caused by the code for the Media Viewer only being loaded after the thumbnails for the images have been loaded, because this problem tends to not be reproducible if you go back to the page after the thumbnails are cached, even if you're really quick about clicking a picture.
Comment 1 Mark Holmquist 2014-03-11 17:44:37 UTC
I don't think we can do anything currently to make the loading any faster, but Gilles may beg to differ.

FWIW I asked Krinkle about loading MMV top-side and he said it wasn't necessary, so that's not our path forward.
Comment 2 Dan Garry 2014-03-11 19:10:20 UTC
I've set the priorities on this based on Mark's comments. Anyone involved in the development of Media Viewer should feel free to revise as necessary.
Comment 3 Tisza Gergő 2014-03-11 21:48:36 UTC
MMV is just a 16K bootstrap file now, so top-loading it does not sound that bad to me. I don't see other options apart from wontfixing this - until it is not loaded, we cannot interfere in any way with what an image click does.
Comment 4 Dan Garry 2014-03-11 21:58:24 UTC
(In reply to Tisza Gergő from comment #3)
> MMV is just a 16K bootstrap file now, so top-loading it does not sound that
> bad to me. I don't see other options apart from wontfixing this - until it
> is not loaded, we cannot interfere in any way with what an image click does.

The bug itself is relatively minor, but on the other hand the inconsistency of user experience this causes is relatively severe. I was left wondering whether Media Viewer was broken, whether I'd forgotten to enable it on my account (I had to check that), and then I cleared my cache and tried again which actually caused the problem to happen again.

CCing Krinkle to get his input on fixing this.
Comment 5 Mark Holmquist 2014-03-12 23:51:32 UTC
Actually, I may have been thinking about this wrong - we *do* change visual things above the fold when a hash fragment is detected, so maybe we should actually be top-loading.

We will talk about this tomorrow at the planning meeting, I think.
Comment 6 Gilles Dubuc 2014-03-27 14:44:54 UTC
There is a foolproof technical solution for this: an inline onclick handler defined in the HTML that "replays" the click when the DOM is loaded.

Shoving all the mmv bootstrap code in the head is inefficient and it wouldn't solve the problem: on a cold cache it still takes time to download the JS file, and you might see the DOM appear on the page before the JS is actually loade & executed. So there would still be a chance to trigger this situation. The window would be smaller, but it could still happen.
Comment 7 Gilles Dubuc 2014-03-27 14:45:53 UTC
And by replay I mean that it would of course swallow the original click that happens before the DOM is ready and replay it on DOM readiness. I didn't mean having the event twice for a single click.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links