@@ -89,10 +89,12 @@ define([
8989 app . actions . execute ( 'articles:oneFullArticle' ) ;
9090 } ,
9191
92- handleMouseDown ( event ) {
92+ handleMouseDown ( event ) {
9393 if ( event . button === 1 ) {
9494 const linkElement = event . target . closest ( 'a' ) ;
95- this . prefetcher . href = linkElement . href ;
95+ if ( typeof browser !== 'undefined' ) {
96+ this . prefetcher . href = linkElement . href ;
97+ }
9698 }
9799 } ,
98100
@@ -132,11 +134,13 @@ define([
132134 * @method initialize
133135 */
134136 initialize : function ( ) {
135- this . prefetcher = document . createElement ( 'link' ) ;
136- this . prefetcher . rel = 'preload' ;
137- this . prefetcher . setAttribute ( 'as' , 'fetch' ) ;
138- this . prefetcher . setAttribute ( 'crossorigin' , 'crossorigin' ) ;
139- document . head . appendChild ( this . prefetcher ) ;
137+ if ( typeof browser !== 'undefined' ) {
138+ this . prefetcher = document . createElement ( 'link' ) ;
139+ this . prefetcher . rel = 'preload' ;
140+ this . prefetcher . setAttribute ( 'as' , 'fetch' ) ;
141+ this . prefetcher . setAttribute ( 'crossorigin' , 'crossorigin' ) ;
142+ document . head . appendChild ( this . prefetcher ) ;
143+ }
140144
141145
142146 bg . items . on ( 'reset' , this . addItems , this ) ;
0 commit comments