简体   繁体   English

FireFox的无头浏览器(类似于适用于Chrome的PhantomJS)

[英]Headless browser for FireFox (similar to PhantomJS for Chrome)

Is there a headless browser for FireFox (similar to PhantomJS for Chrome), that can be used with Karma? 是否有适用于Karma的FireFox无头浏览器(类似于Chrome的PhantomJS)?

Using the Grunt FireFox Launcher plugin causes, the browser to be launched every single time we build our JavaScript using GRUNT. 使用Grunt FireFox Launcher插件导致,每次我们使用GRUNT构建JavaScript时,浏览器都会启动。 We would like something which is more silent and redirects its output to the console window. 我们想要更安静的内容,并将其输出重定向到控制台窗口。 Very similar to how PhantomJS works for Chrome. 与PhantomJS在Chrome上的工作方式非常相似。 Any ideas? 有任何想法吗?

First and foremost: Phantomjs does not launch Chrome. 首先,Phantomjs不会启动Chrome。 Phantomjs is a javascript implementation of Webkit. Phantomjs是Webkit的JavaScript实现。

Now, if you want to run firefox headlessly you can run it inside XVFB. 现在,如果您想无头运行Firefox,则可以在XVFB中运行它。 Without knowing anything about your build since you haven't included that, I'll just link to node xvfb which is probably a good place to get started: https://github.com/proxv/node-xvfb 由于您还不了解构建,因此我不知道任何相关信息,我将其链接到节点xvfb,这可能是一个入门的好地方: https : //github.com/proxv/node-xvfb

PhantomJS runs webkit not Chrome. PhantomJS运行Webkit而不是Chrome。 It is the same engine but Chrome adds quite a bit more (ie Intl support). 它是相同的引擎,但Chrome增加了很多(即Intl支持)。 There is no equivalent for Gecko -- the equivalent of webkit for Firefox. Gecko没有与之等效的产品-与Firefox相同的webkit。 On Linux or OS X, you can use xvfb with Firefox to stop the window from popping up. 在Linux或OS X上,可以将xvfb与Firefox配合使用来阻止窗口弹出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用无头浏览器Phantomjs打开PDF - Open PDF with headless browser Phantomjs 向phantomJS无头浏览器添加jQuery选择器控件 - Adding jQuery selector control to phantomJS headless browser PhantomJS中的RequireJS错误,但不是Chrome / FireFox - RequireJS errors in PhantomJS but not Chrome/FireFox 如何使用php-phantomjs在无头Chrome中执行Javascript? - How to execute Javascript in headless chrome using php-phantomjs? Phantomjs失败,但测试在Chrome和Firefox中工作正常 - Phantomjs fail but test works fine in Chrome and Firefox Jasmine测试通过了Chrome和Firefox,但是没有使用PhantomJS - Jasmine tests pass in Chrome and Firefox but fail with PhantomJS Headless 浏览器图像质量 - Headless chrome、phantom js、slimmer js - Headless browser image quality - Headless chrome, phantom js, slimmer js 使用 Chrome 无头浏览器获取渲染字体 - Fetch rendered font using Chrome headless browser 使用handlebars.js时,为什么浏览器在Firefox中返回错误“TypeError:this._input为null”(在Chrome中类似)? - Why is browser returning error “TypeError: this._input is null” in Firefox (and similar in Chrome) when using handlebars.js? Web Firefox/Chrome 浏览器控制? - Web browser control for Firefox/Chrome?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM