gpt4 book ai didi

google-chrome-extension - 什么时候run_at : document_idle content script run?

转载 作者:行者123 更新时间:2023-12-04 17:24:20 27 4
gpt4 key购买 nike

运行内容脚本有三个选项:

  • document_start - 在 <head> 开头注入(inject)
  • document_end - 在 DOMContentLoaded 之后立即注入(inject)
  • document_idle - 什么时候注入(inject)???
  • 最佳答案

    根据to the current Chromium source :

    We try to run idle in two places: here and DidFinishLoad. DidFinishDocumentLoad() corresponds to completing the document's load, whereas DidFinishLoad corresponds to completing the document and all subresources' load. We don't want to hold up script injection for a particularly slow subresource, so we set a delayed task from here - but if we finish everything before that point (i.e., DidFinishLoad() is triggered), then there's no reason to keep waiting.



    翻译成网络开发人员的话,这基本上意味着……
    document_idle脚本将运行最早的这些事情之一是真实的:
  • window.onload已解雇
  • 一直是 200ms 自从 DOMContentLoaded已经开除了。

  • 在典型页面上,这些脚本可能会在 #2 处运行。

    关于google-chrome-extension - 什么时候run_at : document_idle content script run?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33248629/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com