gpt4 book ai didi

ruby-on-rails - youtube 视频中的 Phantom JS 错误

转载 作者:行者123 更新时间:2023-12-04 21:16:47 26 4
gpt4 key购买 nike

幻影 JS 版本:1.9.1
恶作剧版本:1.3.0

从今天开始,YouTube 嵌入的视频现在在运行 javascript 测试时会出现 poltergeist 错误。我的 youtube 代码只是默认的嵌入 youtube 代码。下面是一个例子:

<iframe width="560" height="315" src="//www.youtube.com/embed/AW9Z3cGOlGM?rel=0" frameborder="0" allowfullscreen></iframe>

我在启用 javascript 时访问该页面所得到的错误是:
 Failure/Error: page.find(".container.registrations.false.government")["style"].should have_content("test.jpg")
Capybara::Poltergeist::JavascriptError:
One or more errors were raised in the Javascript code on the page. If you don't care about these errors, you can ignore them by setting js_errors: false in your Poltergeist configuration (see documentation for details).

TypeError: 'null' is not an object (evaluating 'a.dataset')
at http://s.ytimg.com/yts/jsbin/www-embed-player-vfl6vSff7.js:97
at http://s.ytimg.com/yts/jsbin/www-embed-player-vfl6vSff7.js:88 in vg
at http://s.ytimg.com/yts/jsbin/www-embed-player-vfl6vSff7.js:85
at http://s.ytimg.com/yts/jsbin/www-embed-player-vfl6vSff7.js:98

同样在一些测试中,poltergeist 就死了。
 Failure/Error: visit root_path
Capybara::Poltergeist::DeadClient:
PhantomJS client died while processing {"name":"visit","args":["http://subdomain13.lvh.me:3003/"]}

此外,它在执行以下操作时不会忽略这些错误:
Capybara.register_driver :poltergeist_without_js do |app|
Capybara::Poltergeist::Driver.new(app, :js_errors => false)
end
Capybara.javascript_driver = :poltergeist_without_js

最佳答案

这是不支持 flash 或 html5 视频的嵌入 JS 处理浏览器中的一个错误:

讨论在 https://productforums.google.com/d/topic/youtube/2Cu87teAGYE/discussion

错误报告位于 https://code.google.com/p/gdata-issues/issues/detail?id=5883

关于ruby-on-rails - youtube 视频中的 Phantom JS 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21438826/

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