【问题标题】:what makes an execution context the "default" one?是什么让执行上下文成为“默认”上下文?
【发布时间】:2021-01-01 00:32:45
【问题描述】:

在 Chrome 的 Puppeteer 中,ExecutionContextDescription.auxData 可以找到包含以下属性的对象:isDefaulttypeframeId

frameId 很容易理解,但其他属性似乎没有在任何地方记录。是什么让执行上下文成为默认上下文?在任何给定时间,每个帧的执行上下文不是总是只有一个吗?

【问题讨论】:

    标签: puppeteer chrome-devtools-protocol


    【解决方案1】:

    来自https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#overview

    Frame 至少有一个执行上下文 - 默认执行上下文 - 在其中执行 frame 的 JavaScript。 Frame 可能具有与扩展关联的其他执行上下文。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-21
      • 2012-08-27
      • 1970-01-01
      • 2012-03-12
      相关资源
      最近更新 更多