- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我知道参数 --virtual-time-budget
in the source 的文档Chromium,但我觉得我不理解它:
// If set the system waits the specified number of virtual milliseconds before
// deeming the page to be ready. For determinism virtual time does not advance
// while there are pending network fetches (i.e no timers will fire). Once all
// network fetches have completed, timers fire and if the system runs out of
// virtual time is fastforwarded so the next timer fires immediately, until the
// specified virtual time budget is exhausted.
const char kVirtualTimeBudget[] = "virtual-time-budget";
我做了一些实验,结果让我感到困惑:
# I'm on macOS; you may change this alias according to your own OS
$ alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
$ chrome --version
Google Chrome 70.0.3538.110
$ time chrome --headless --disable-gpu --print-to-pdf https://www.chromestatus.com/
real 0m0.912s
user 0m0.264s
sys 0m0.219s
$ time chrome --headless --disable-gpu --print-to-pdf --virtual-time-budget=10000 https://www.chromestatus.com/
real 0m2.502s
user 0m0.347s
sys 0m0.244s
$ time chrome --headless --disable-gpu --print-to-pdf --virtual-time-budget=100000 https://www.chromestatus.com/
real 0m15.432s
user 0m0.759s
sys 0m0.406s
$ time chrome --headless --disable-gpu --print-to-pdf --virtual-time-budget=1000000 https://www.chromestatus.com/
real 0m15.755s
user 0m0.755s
sys 0m0.401s
我以为 Chrome 在上述四个示例中会等待 0、10、100 和 1000 秒,然后再打印到 PDF,但实际的等待时间似乎相去甚远。我的问题是,如何让 Chrome 在将页面打印为 PDF 之前肯定等待 X 秒?我目前只考虑 Chrome CLI,并没有寻找像 Puppeteer 这样的工具。
最佳答案
我可以轻松回答您的标题问题(这解释了您的结果)。 --virtual-time-budget,说明进程将等待页面加载的时间,而不是它会等待那么长时间。如果请求的结果可用(没有更多的网络请求待处理),它将立即返回结果。
返回的信息应该是正确的,除非混合了 AJAX 请求或其他 Javascript。如果是这样,您必须诉诸 Javascript/DOM 操作来解决问题。
关于google-chrome - Chrome CLI 的参数 --virtual-time-budget 的真正含义是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53548438/
运行 npm build --prod 时出现以下错误:Error: budgets: initial exceeded maximum budget. Budget 1.00 MB was not
当我尝试向 MySQL 表中插入内容时遇到此错误。可能的原因是什么?如何解决这个问题? “预算”的原始值为800元,插入后变成800,少了元。 最佳答案 这意味着您尝试插入的数据会溢出该列分配的存储空
本文关键词:LeetCode,力扣,算法,算法题,字符串,并查集,刷题群 题目地址:https://leetcode-cn.com/problems/get-equal-substrings-wit
问题 我向 Facebook 的广告集 API 发出请求,尝试使用以下 JSON blob 创建广告集,但收到的错误是“您的预算太低。此广告集的最低预算为 32.04 美元”。 广告组设置为使用 au
我的 ImageActivity 上有 ImageView 和一个按钮。单击该按钮时,会列出可用的图像,单击其中一张图像时,会将其加载到 ImageView 中。 ImageView XML:
我不断收到此错误,错误指向此代码: bitmap = BitmapFactory.decodeByteArray(pic1 , 0, pic1.length); 图片来自sqlite数据库,用户从手机
我知道,您可以找到数百个关于这个特殊主题的问题,但我已经阅读了其中的大部分,但它们没有帮助。这是堆栈跟踪: java.lang.OutOfMemoryError: bitmap size exceed
我遇到了一个 OutOfMemoryError 问题,即位图大小在更改 Droid 移动设备的方向时超出了 vm 预算(但在任何其他移动设备中都没有,例如 Android normal 和 Andro
我一直在使用图像加载器类在 ListView 中进行延迟加载。它工作正常,但我一直在处理大量将从网络服务下载的位图。所以现在我得到的位图大小超出了 VM 预算。将 bitmapfactory 大小增加
必须将所有 SD 卡图像加载到交错 View 中。当我将计数设置为 100 时,它显示交错 View 中的图像,但对于许多没有图像(例如 700/800)我使用 AsyncTask 但它显示 doin
抱歉,这似乎是一个重复的问题,但我认为我不符合已发布的任何建议的条件。 我的应用程序中有一个最多包含 20 张图片的图库。来回玩了一段时间后,我遇到了 OutOfMemoryError。 奇怪的是我没
这是我的代码: File file = new File(Jpeg文件大小为700kb的路径); InputStream in = null; try { in = new
这个问题已经有答案了: 已关闭10 年前。 Possible Duplicate: Android: Strange out of memory issue while loading an imag
我在追踪“位图大小超出 VM 预算”错误时遇到了很大的问题。我查看了其他问题,并尝试了所有建议(取消分配资源,使用 bitmap.recycle() 并将变量、位图、 Canvas 设置为空,当 Ac
下面的代码直到今天都可以正常工作。但我现在不知道它不工作并给出以下错误。你能告诉我为什么吗? Error: Function DocumentReference.set() called with i
在 BitmapFactory 中获取异常。不确定是什么问题。 (嗯,我可以猜到这个问题,但不知道为什么会发生) ERROR/AndroidRuntime(7906): java.lang.OutOf
这个问题在这里已经有了答案: 关闭10年前. Possible Duplicate: Android: Strange out of memory issue while loading an ima
我知道参数 --virtual-time-budget in the source 的文档Chromium,但我觉得我不理解它: // If set the system waits the spec
每当我在模拟器上测试时,我都会收到上述错误,但在我测试过的任何设备上都不会。任何人都可以提出为什么会发生这种情况吗? 最佳答案 您可能正在具有 32Mb 或更多堆大小内存的高端设备上进行测试。模拟器可
我尝试在单击按钮时加载动画。我在资源文件夹中有 90 张图片,我尝试加载它们,每张图片大约有。大小 50kb 当我点击按钮启动动画时,我得到了 OutOfmemory 异常。请检查以下代码。任何帮助将
我是一名优秀的程序员,十分优秀!