我正在网站上嵌入一个Youtube的iframe,但是它在我的控制台中抛出以下警告:
[违规操作]添加了非被动事件监听器到一个阻止滚动的'touchstart'事件。考虑将事件处理程序标记为“被动”以使页面更加响应。请参见https://www.chromestatus.com/feature/5745543795965952 base.js:4560
[违规操作]'setTimeout'处理程序耗时115毫秒www-embed-player.js:583
我确定是这个组件引起的,因为当我注释掉它时,警告就停止了。我想要摆脱这些警告。该怎么做?
<iframe width="100%" height="300px" src="https://www.youtube.com/embed/wHcyxs6pGIk" frameborder="0" allow="accelerometer; autoplay; gyroscope; picture-in-picture" allowfullscreen></iframe>