Violation Long running JavaScript task took xx ms

1

I have implemented a video <iframe> of youtube on a page and I get this notice in Chrome 56 :

[Violation] Long running JavaScript task took xx ms (50ms allowed) www-embed-player.js

Should we worry?

In FireFox I do not get any notice. A Chrome bug maybe?

    
asked by aldanux 26.02.2017 в 03:00
source

1 answer

1
  

I have edited the answer with new information.

It is a bug of all browsers that only Chrome detects, for now

Apparently it is a bug, reported in Chromium.org .

I have read that it is not just a Chrome bug, but all browsers, but the only one that detects it for now is Chrome:

  

The underlying problems are there in the other browsers but the   browsers just are not telling you there's a problem.

 The   underlying problems are there in the other browsers, but the   browsers are simply not saying there is a problem.   Source: One of the answers to the question: Violation Long running JavaScript task took xx ms of Stackoverflow in English .

Regarding your question:

  

Should we worry?

According to OS in English :

These messages are warnings instead of errors because they really are not going to cause big problems. It can cause the frames to fall ... and other problems, but not linked to security.

Regarding security, do not worry , it is a warning that something is not optimized on our page. Then yes you have to worry about optimizing our content (see some links at the end).

Possible solutions

In gonodejs They give several possible solutions to the problem (in English). Although I personally consider that it is not worth trying, since the message is resolved in Chrome 57 ...

It is already resolved, the message

Chrome 58 still in beta, hide these and other messages from debugging by default. To show them you have to click on the arrow next to 'Info' and select 'Verbose'.

Chrome 57 , now available, enables "hide violations" by default. To activate them again, you must activate the filters and uncheck the "Hide violations" box.

But ... there is a pending task

The pending task is OPTIMIZE .

Even if you no longer see the annoying message, it is possible that there is an optimization problem in our application.

What to do then? Definitely update to the latest version of Chrome and occasionally activate the Verbose mode to see if there is something that needs to be optimized.

In terms of optimization, you can find interesting content in Chrome Dev Tools, also in Spanish. I leave you only some links that I found:

The answer quoted above from Stackoverflow in English also provides some suggestions regarding optimization.

    
answered by 25.03.2017 / 18:50
source