Page MenuHomePhabricator
Paste P8540

Debug MediaViewer image loading
ActivePublic

Authored by Tgr on May 18 2019, 8:59 PM.
Tags
None
Referenced Files
F29117502: raw.txt
May 18 2019, 8:59 PM
Subscribers
None
let wrap = function ( obj, field, cb ) { let oldcb = obj[field]; obj[field] = function ( ...args) { console.log( field + ' -> ' + args ); return cb.call( obj, oldcb.bind( obj ), ...args ); }; };
let delay = function ( time, value ) { let d = $.Deferred(); setTimeout( function() { d.resolve( value ); }, time ); return d.promise(); }
wrap( mw.mmv.viewer.imageProvider, 'get', function( oldcb, ...args ) { return delay( 200, oldcb( ...args ) ); } );

Event Timeline