简体   繁体   中英

Modernizr converts all _self target links to _blank

I am using Modernizr in my application and somehow it is converting the links from
<a href="URL" target="_self"> to <a href="URL" target="_blank"> .

I want to some links to open in the same window, even if they goes to different domain.

Below are the features for Modernizr I am using:

Build https://modernizr.com/download?-applicationcache-audio-backgroundsize-bgpositionxy-bgsizecover-borderimage-borderradius-boxshadow-boxsizing-canvas-canvastext-checked-cssanimations-csscolumns-cssgradients-csshyphens_softhyphens_softhyphensfind-cssreflections-cssscrollbar-csstransforms-csstransforms3d-csstransitions-ellipsis-flash-flexbox-flexboxlegacy-fontface-generatedcontent-geolocation-getusermedia-history-hsla-indexeddb-inlinesvg-input-inputtypes-lastchild-localizednumber-localstorage-matchmedia-microdata-multiplebgs-nthchild-opacity-placeholder-postmessage-rgba-sessionstorage-smil-supports-svg-svgasimg-svgclippaths-svgfilters-target-textshadow-video-webgl-websockets-websqldatabase-webworkers-domprefixes-hasevent-mq-prefixes-printshiv-setclasses-testallprops-testprop-teststyles-dontmin

If anyone knows which feature does that and how to customize or block it from doing so, please tell.

The only thing that Modernizr changes in entire DOM is the class attribute of HTML. So, whatever it is, it is not Modernizr .

It might be (and probably is) some bit of code that does this change depending of either HTML class being present/not present ( .property or .no-property )

or window.Modernizr being present/not present or having object property Modernizr.property === true | Modernizr.property === false Modernizr.property === true | Modernizr.property === false .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM