【问题标题】:How to take cross origin screenshots using html2canvas-proxy如何使用 html2canvas-proxy 进行跨域截图
【发布时间】:2023-02-11 12:22:26
【问题描述】:

努力将 html2canvas-proxy 用于跨源屏幕截图。据我了解,将 url 作为参数传递 (localhost:xxxx?url=https://...) 将图像屏幕截图数据作为 base 64 字符串 (check blob) 返回。 这仅在 url 参数是图像源时有效。在使用任何其他 url 并将其用作图像源时,我只得到替代文本。

例如,代理与 https://placebear.com/200/300 一起工作,但无法与 https://google.com 一起工作作为 url 参数。

任何帮助将非常感激

【问题讨论】:

    标签: proxy html2canvas


    【解决方案1】:

    html2canvas代理仅用于结合使用html2画布库本身。它是一个启用了 CORS 的 NodeJS 服务器,因此 html2canvas 可以将跨域图像 URL 发送到并接收相应的 base64 数据 URL,以便在画布中进行处理。

    它不能用作接收网站 URL 并返回该网站屏幕截图的服务器。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-10-25
      • 2012-03-04
      • 1970-01-01
      • 1970-01-01
      • 2020-10-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多