nwjs / nw.js

Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.
https://nwjs.io
MIT License
40.32k stars 3.89k forks source link

headless version #769

Open megablue opened 11 years ago

megablue commented 11 years ago

It would be great that if node-webkit are made into headless version...

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

vsemozhetbyt commented 9 years ago

+1. It would be great for automatic web data processing too.

dotproto commented 9 years ago

+1 with some background.

I'm looking for a way to create on a simple command line utility that I can use to communicate with a service I'm working on. Ideally the utility would be a cross-platform, single-file distributable I can pass someone. This would provide a turnkey way for them to leverage my service without having to install Node or any other tools.

MContagious commented 9 years ago

Looking forward for this feature.

jonnysamps commented 9 years ago

+1

jwerle commented 9 years ago

+1

xenyou commented 9 years ago

+1

chrisdack commented 9 years ago

+1. I'm having issues with PhantomJS as my webApp utilises a huge amount of socket.io and the two don't play nice. A NW solution would be fantastic.

iradul commented 9 years ago

+1

drom commented 9 years ago

+1

michalliu commented 9 years ago

Sorry to bother, is there anyone knows what's the status of this feature now?

edwardchanjw commented 9 years ago

It is like the feature for next version release update. Even with talented contributor here, we giving huge backlog of bleeding edge request here on nwjs, we should wait patiently or help fix some bug.

I consolidate few advantages from @kaizhu256, @cretz, and many other that may give more insight that I overlook due to long page of comment:

polpo commented 9 years ago

My use case is a single Linux executable that has a GUI but also can also be used from the command line on a system with no running X server.

BenoitZugmeyer commented 9 years ago

FYI:

Atom-shell closed their similar issue a few days ago. As stated, this is more a chromium issue than an atom-shell issue, and thus, should probably never be fixed.

Phantomjs 3 plans to be chromium based with the QtWebEngine widgets. I have no idea if the QtWebEngine supports the headless Qt platforms though.

edwardchanjw commented 9 years ago

Graphical system is like legend for me, Is that wayland or similar other is a choice to reduce dependency of Graphical component.

Chromium seem using an abstraction layers for existing Graphical system: http://www.chromium.org/developers/design-documents/ozone

There is a line in that I read as dump people, because underlying it might have some magic happen.

Ozone Platforms Internal platforms: caca - Draws graphical output to text using libcaca. In case you ever wanted to test embedded content shell on tty. Add libcaca to your favourite Chromium development workstation and build like so:

monolithed commented 9 years ago

+1

vsantosu commented 9 years ago

Yep, I need webrtc, this will save my life.

steelbrain commented 9 years ago

@BenoitZugmeyer atom-shell now Electron supports headless version, 'cause they use that to run Atom Editor's tests in CI services and CI services don't have a monitor :wink:

BenoitZugmeyer commented 9 years ago

@steelbrain no, they are using xvfb https://github.com/atom/electron/blob/d158dbdb68aab651792ba5cbe602394ad0c7046f/script/cibuild#L46

yunqingmo commented 9 years ago

Thanks,The problem has been solved

twilly86 commented 9 years ago

I followed this post... http://twolfson.com/2014-11-22-moving-from-phantomjs-to-node-webkit and was able to mimic phantomjs functionality.

It's not headless in the sense that I can see node webkit's browser but I'm able to load a webpage and take a screenshot in the background.

What are the drawbacks/benefits of going from what's in that post to truly headless?

JohnnyMarnell commented 9 years ago

+1 again for web-audio (without alternatives' overhead)

CaptEmulation commented 8 years ago

+1 want to use chromium based instead of webkit based server side image rasterization. Is a huge pain to get nw running "headless" with xvfb. But it does work.

oknoorap commented 8 years ago

+1 My experience with phantomjs is I'm very frustated, recently, I was scraping soundcloud, it's seems that soundcloud use webpack, and phantomjs not support webpack, I don't know, I can't ignore errors, and process stopped, :sigh. Btw, I've been using nwjs for 4 years and It will be great if nwjs has headless feature. Absolutely it will replace phantomjs.

jssuttles commented 8 years ago

+1 for nwjs headless. I currently have Linux users running xvfb so that they can run my app as a service. However, most people are running it with the GUI, and I don't want to build an extra app just for people that want to run it as a service. Since this hasn't been implemented, I'm trying to create a windows service using nssm. However, I'm running into the same problem as I did on Linux. I need a windows alternative to xvfb.

FeepingCreature commented 8 years ago

+1

A headless version of node.js that was capable of WebRTC usage would be exactly what I need. Xvfb does for now, but it's not great.

ChrisWoodlief commented 8 years ago

+1 would be amazing for my use case. This would kill the need for 2 separate code bases and allow everything to be done with NWJS

jssuttles commented 8 years ago

Currently trying cygwin -> cygrunsrv -> xvfb-run -> nw.js 0.13.1 on Windows. Xvfb-run does not work the same on Windows as on Linux. I get this message: [4736:3124:0328/142826:ERROR:native_app_window_views.cc(490)] Failed initializing an ITaskbarList interface.

jssuttles commented 8 years ago

Found winsw and node-windows. Looks to work. But we still don't like the workaround.

Cooker-Monster commented 8 years ago

+1 for nwjs headless ... Not familiar with Xvfb and I'm wondering what is its overhead (memory+cpu) when we want to mimic headless with it ?

ben-page commented 8 years ago

:+1:

buschtoens commented 8 years ago

Please refrain from +1-ing and that would be great, because...-ing this issue. This only clutters the participants inboxes.

The maintainers have understood that there is a demand for this feature. If you'd still like to express your appreciation, you can do so by adding a reaction emoji to the original issue (or to a comment).

If you have to add something of value, like a concrete implementation approach, feel free to do so. Even better yet, start a PR.

You can also post a bounty.

Thanks. :smile:

vsemozhetbyt commented 8 years ago

https://twitter.com/samccone/status/739166801427210240

rogerwang commented 8 years ago

Thanks, have been following the issue for a while. We need to migrate to GN build before doing this.

On Sun, Jun 5, 2016, 5:30 AM vsemozhetbyt notifications@github.com wrote:

https://twitter.com/samccone/status/739166801427210240

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/nwjs/nw.js/issues/769#issuecomment-223779343, or mute the thread https://github.com/notifications/unsubscribe/AAKGGYm5m4TUVQSK8Z3_XWtAbreXiUMpks5qIe5WgaJpZM4At0L7 .

damoebius commented 8 years ago

+1 for a headless version running on a headless server Today we use nwjs as a rendering server, so we need a but not a display output.

vsemozhetbyt commented 8 years ago

https://docs.google.com/presentation/d/1gqK9F4lGAY3TZudAtdcxzMQNEE7PcuQrGu83No3l0lw/preview

Sesshomurai commented 8 years ago

Problem solved!

Sent from my Verizon Wireless 4G LTE smartphone

-------- Original message -------- From: vsemozhetbyt notifications@github.com Date: 06/24/2016 6:38 AM (GMT-05:00) To: "nwjs/nw.js" nw.js@noreply.github.com Cc: Sesshomurai darren@ontrenet.com, Mention mention@noreply.github.com Subject: Re: [nwjs/nw.js] headless version (#769)

https://docs.google.com/presentation/d/1gqK9F4lGAY3TZudAtdcxzMQNEE7PcuQrGu83No3l0lw/preview

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

SantoshSrinivas79 commented 8 years ago

I'm still wrapping my head around this and wish someone would write a n00b guide .. but here is a video off the presentation. BlinkOn 6 Day 2 Talk 1: Headless Chrome - YouTube

Hope someone here will post a guide for dummies to get this working :-)

rogerwang commented 7 years ago

I'm collecting the feature requests here for our headless plan in future:

What do you need for a headless NW.js build flavor? Currently as I see all the need can be fulfilled by upstream headless project and a Node.js API for it

If no one brings any idea for a significant differentiation between NW and Chromium I'll close this issue as the feature is done by upstream.

polpo commented 7 years ago

My main need for headless is the ability to run my NW.js app (with nwjc-compiled modules) on the command line in Linux without an X11 server running. So far my workaround has been to start an Xvfb server but I'd much prefer to not rely on that.

drom commented 7 years ago

@rogerwang I need NWJS application that combines Node and Browser DOM rendering and can run in pure CLI mode when needed. Agree with @polpo

damoebius commented 7 years ago

@rogerwang my NWJS application use the Node Api AND the DOM, Canvas, WebGL, WebWorker, to compute images at server side. It could be run in pure CLI on a headless server

tentone commented 7 years ago

I can see myself in the future using it for a webserver that processes image with webgl :)

Do code starts from an HTML file samr way as with the not headless one?

tekrat commented 7 years ago

After started headless we could we have a way for additional interactions. The 'console' could be extended to include something like the interactive function below. That would left it run as a full shell or console application and just command line switch. This maybe more useful if doing an SSH into a server. Some of these are things I look for from my BBS days :).

All of these are variation on the console.log() function. The main difference is that they extend the 'console' object for input and output in an interactive console/shell application:

Mithgol commented 7 years ago

I feel that a headless NW.js build flavor would be quite useful when it becomes necessary to test the behaviour of custom builds (builds made by nw-gyp and targeting NW.js specifically) of binary addons that reside in Node.js modules (such as sqlite3 or serialport for example).

Such modules cannot be tested merely on a headless Chromium (because the modules need Node.js API) or in NW-less Node.js (because the addons are rebuilt to have NW.js ABI).

Additionally, if the tests are running on Travis CI, then it's quite beneficial to migrate from their old infrastructure to their new container-based infrastructure (because then builds start much faster and they also run faster), but after such migration there's no sudo and thus (obviously) no sudo xvfb-run tricks (mentioned above by @chriddyp) are possible to run an unmodified NW.js headlessly.

(I must admit that Travis CI instances have xvfb installed and thus it's still possible to achieve something but I'd still be more comfortable with an NW.js build which is already headless.)

jonnermut commented 7 years ago

@rogerwang the obvious differentiator is also the killer feature of nw.js itself - running nodejs and a full DOM in the same JS context. Having a headless mode opens up very useful server side rendering possibilities.

kardianos commented 7 years ago

(I apologize for the drive by comment.)

I'm looking for a replacement for wkhtmltopdf on windows server (no xvfb) for generating reports; the two major issues with wkhtmltopdf is it still uses the OS DPI settings (reports vary from dev to server) and isn't staying up to date with recent versions of webkit so old bugs are hurting more and more.

I'd like to note two interesting developments:

  1. Google chrome is growing a --headless flag in the standard build,
  2. The addition in NW.js of the win.print method.

I would also like to note I've seen phantomjs and I cannot use it for my purpose (generating PDF reports). Right now depending on wkhtmltopdf which depends on QT webkit isn't a sustainable option. It would be great to have an alternative.

julkue commented 7 years ago

Why can't you use Phantomjs?

kardianos commented 7 years ago

phantomjs_long_page.pdf wkhtmltopdf_long_page.pdf

phantomjs doesn't support page-breaks and doesn't go through a print pipeline in general. See attached files for differences.

julkue commented 7 years ago

Can you please share your Phantomjs settings?

kardianos commented 7 years ago

@julmot You are correct, I may be able to use phantomjs using something like https://github.com/ariya/phantomjs/blob/master/examples/rasterize.js . I'm sorry for the distraction.