A Parser-blocking, cross-origin script is invoked via [removed] - how to circumvent it?

前端 未结 3 1614
挽巷
挽巷 2020-12-12 15:57

Google Chrome started implementing Blocking the load of cross-origin, parser-blocking scripts inserted via document.write in the main frame on slow networks, which causes th

相关标签:
3条回答
  • 2020-12-12 16:02

    According to Google Developers article, you can:

    • Use asynchronous script loading, using <script src="..." async> or element.appendChild(),
    • Submit the script provider to Google for whitelisting.
    0 讨论(0)
  • 2020-12-12 16:07

    Don't use document.write, here is workaround:

    var script = document.createElement('script');  
    script.src = "....";  
    document.head.appendChild(script);
    
    0 讨论(0)
  • 2020-12-12 16:22

    @niutech I was having the similar issue which is caused by Rocket Loader Module by Cloudflare. Just disable it for the website and it will sort out all your related issues.

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