29

I am trying to compile PhantomJS to add WebGL. Apparently it is possible because of:

However, I have no idea how to do this. I have looked in all the configuration for compiling and I tried and found nothing. Should I compile QTWebKit separately with the necessary options and then compile PhantomJS with this WebKit? I'm on Mac OSX Lion.

It would be really nice to have a bit of help.

charly
  • 956
  • 13
  • 23
  • 1
    I have dug a little bit and found that I needed to compile with OpenGL (did this by removing QT_CFG+=' -no-opengl' from `src/qt/preconfig.sh`) and ENABLE_WEBGL in the webkit config. However after this I noticed that some part of the Qt source were absent (opengl for eg). I replaced the source with Qt 4.8.4 but I still get compilation errors. I must be missing something any ideas? – charly May 18 '13 at 20:44
  • I have FTM worked around this by using Canvas instead of WebGL but the performances are obviously not as good so I'm still interested by your answers – charly May 21 '13 at 09:18
  • 2
    If you don't have any other requirements (unlikely) consider [slimerjs](http://slimerjs.org/features.html) which is similar but Gecko/Mozilla FF based and supports WebGL. – Basic Dec 17 '13 at 12:02

2 Answers2

1

As you well may know, Phantomjs has is no longer being actively developed.

I suggest you move to Puppeteer which uses Chromium: https://pptr.dev/

Chris Buck
  • 745
  • 5
  • 15
0

This was opened by ariya who also commented on the Google Groups thread as a GitHub issue.

According to this comment by a project collaborator on that issue:

That's not that easy. WebGL requires OpenGL. OpenGL requires XCB on Linux. That means that you will not be able to use PhantomJS in full headless environment. I doubt that this will be implemented in near future.

It seems to me like this is the final answer to the OP's question. The OP has not addressed whether SlimerJS would actually work in their situation.

Ed.
  • 1,992
  • 1
  • 13
  • 30