Chrome violation : [Violation] Handler took 83ms of runtime

后端 未结 3 1665
-上瘾入骨i
-上瘾入骨i 2020-12-24 04:38

I\'m trying to implement the Facebook\'s logout functionality in my project. Login works just fine. But I\'m facing the getting the following message in JavaScript console w

相关标签:
3条回答
  • 2020-12-24 04:50

    Perhaps a little off topic, just be informed that these kind of messages can also be seen when you are debugging your code with a breakpoint inside an async function like setTimeout like below:

    [Violation] 'setTimeout' handler took 43129ms
    

    That number (43129ms) depends on how long you stop in your async function

    0 讨论(0)
  • 2020-12-24 05:00

    It seems you have found your solution, but still it will be helpful to others, on this page on point based on Chrome 59.

    4.Note the red triangle in the top-right of the Animation Frame Fired event. Whenever you see a red triangle, it's a warning that there may be an issue related to this event.

    If you hover on these triangle you can see those are the violation handler errors and as per point 4. yes there is some issue related to that event.

    0 讨论(0)
  • 2020-12-24 05:08

    "Chrome violations" don't represent errors in either Chrome or your own web app. They are instead warnings to help you improve your app. In this case, Long running JavaScript and took 83ms of runtime are alerting you there's probably an opportunity to speed up your script.

    ("Violation" is not the best terminology; it's used here to imply the script "violates" a pre-defined guideline, but "warning" or similar would be clearer. These messages first appeared in Chrome in early 2017 and should ideally have a "More info" prompt to elaborate on the meaning and give suggested actions to the developer. Hopefully those will be added in the future.)

    0 讨论(0)
提交回复
热议问题