diff --git a/extension.json b/extension.json index 5beafb29c..ebde9fbd6 100644 --- a/extension.json +++ b/extension.json @@ -148,11 +148,13 @@ } }, "ext.popups": { + "targets": [ "desktop", "mobile" ], "scripts": [ "resources/ext.popups/index.js" ] }, "ext.popups.main": { + "targets": [ "desktop", "mobile" ], "scripts": [ "resources/dist/index.js" ], diff --git a/resources/ext.popups/index.js b/resources/ext.popups/index.js index 188e42915..75ec6c916 100644 --- a/resources/ext.popups/index.js +++ b/resources/ext.popups/index.js @@ -1,4 +1,8 @@ -// Load Popups outside the critical rendering path (T176211) +// Load Popups outside the critical rendering path (T176211) provided that touch events +// are not available in the browser. If touch events are enabled page previews will not load. mw.requestIdleCallback( function () { - mw.loader.using( 'ext.popups.main' ); + var isTouchDevice = 'ontouchstart' in document.documentElement; + if ( !isTouchDevice ) { + mw.loader.using( 'ext.popups.main' ); + } } );