简体   繁体   English

Modernizr将所有_self目标链接转换为_blank

[英]Modernizr converts all _self target links to _blank

I am using Modernizr in my application and somehow it is converting the links from 我在应用程序中使用了Modernizr,并且某种程度上它正在转换来自
<a href="URL" target="_self"> to <a href="URL" target="_blank"> . <a href="URL" target="_self"><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: 以下是我正在使用的Modernizr的功能:

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. 在整个DOM中, Modernizr唯一更改的是HTML的class属性。 So, whatever it is, it is not Modernizr . 因此,无论是什么,它都不是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 ) 可能(可能是)一些代码会根据存在或不存在的HTML类( .property.no-property )进行此更改。

or window.Modernizr being present/not present or having object property Modernizr.property === true | Modernizr.property === false window.Modernizr存在/不存在或具有对象属性Modernizr.property === true | Modernizr.property === false Modernizr.property === true | Modernizr.property === false . Modernizr.property === true | Modernizr.property === false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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