Ticket #39797: 39797.1.diff
File 39797.1.diff, 1.0 KB (added by , 8 years ago) |
---|
-
src/wp-includes/js/customize-preview.js
145 145 return; 146 146 } 147 147 148 // Allow internal jump links and JS links to behave normally without preventing default. 148 149 isInternalJumpLink = ( '#' === link.attr( 'href' ).substr( 0, 1 ) ); 149 150 // Allow internal jump links to behave normally without preventing default. 151 if ( isInternalJumpLink ) { 150 if ( isInternalJumpLink || ! /^https?:$/.test( link.prop( 'protocol' ) ) ) { 152 151 return; 153 152 } 154 153 … … 334 333 return; 335 334 } 336 335 337 // Ignore links with href="#" or href="#id".338 if ( '#' === $( element ).attr( 'href' ).substr( 0, 1 ) ) {336 // Ignore links with href="#", href="#id", or non-HTTP protocols (e.g. javascript: and mailto:). 337 if ( '#' === $( element ).attr( 'href' ).substr( 0, 1 ) || ! /^https?:$/.test( element.protocol ) ) { 339 338 return; 340 339 } 341 340