-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Building phantomjs with Flash support (v1.4.1 the most probable candidate) #11179
Comments
Issue is being also discussed here |
@sunnybear: If you want to give value to other community members with Flash support—and I guarantee you'd make a fair number of people happy indeed!)—I'd recommend try to figure out how to patch the current release of PhantomJS to undo all the changes that were made between 1.4.x and 1.5.0 to facilitate the removal of plugin support. There are 128 commits between those versions: 1.4.1...1.5.0 However, most of them are irrelevant to your purposes, so you just need to find the ones that matter... basically anything that involves/mentions:
I did a quick scan for you and I believe it can be narrowed down a bit to this 57-commit range: 0d77f58...c2c80c0 If you can achieve all that, then this discussion should help you enable Flash in particular afterward: |
@JamesMGreene: thank you very much for your comment. But I can't build from sources any version of phantomjs on CentOS 5.7 - this is the main reason of this issue. The latest builds (i.e. 1.8.2) fail with the different output, but I think resolving the upper issue also can help to provide a stable build with flash support. |
BTW, explanation of the need to also undo the "headless" changes in addition to the "plugin support" changes, per past discussions of my own with @ariya:
[1] "that" → Undoing this commit: 8c7b586f03 |
|
Command line must contain option --load-plugins=yes - so the correct ones will be DISPLAY=:0 ./phantomjs --load-plugins=yes ../examples/rasterize.js URL SCREENSHOT_FILE or xvfb-run --server-args="-screen 0, 1024x768x24" ./phantomjs --load-plugins=yes ../examples/rasterize.js URL SCREENSHOT_FILE |
Also to emulate Flash support in phantomjs browser you need to add before page.open the following (at least plugins and mimeTypes - to pass all Flash detection tests correctly) page.onInitialized = function () { page.evaluate(function () { window.navigator = { plugins: {length: 2, 'Shockwave Flash': {name: 'Shockwave Flash', description: 'Shockwave Flash 11.6 r602'}}, mimeTypes: {length: 2, "application/x-shockwave-flash": {description: "Shockwave Flash", suffixes: "swf", type: "application/x-shockwave-flash", enabledPlugin: {description: "Shockwave Flash 11.6 r602"}} }, appCodeName: "Mozilla", appName: "Netscape", appVersion: "5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22", cookieEnabled: true, language: "en", onLine: true, platform: "CentOS 5.7", product: "Gecko", productSub: "20030107", userAgent: "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22", }; }); }; |
We have no intention to go back to version 1.4, let alone to reenable plugin support there. I know this information can be useful to others but it serves us little to no purpose if it is being discussed here. Can you just create a project (perhaps by forking this one) for this purpose? |
I'm not a C++ programmer but an entrepreneur. If you can give me rights to edit Documentation - I will create and manage (or my people will do) a special page how to lauch PhantomJS with Flash. But I not going to create a branch of this beautiful project (it's really cool). Some additions to the upper instruction. Flash 11 from Adobe (the latest for now) seems not to work for me, downgraded to Flash 10 by the following command rpm -ivh http://dl.atrpms.net/el5-i386/atrpms/bleeding/flash-plugin-10.2-1.i386.rpm |
@sunnybear As I wrote before, we do not want to include any materials referencing plugin support because of various reasons. It's not officially supported and we don't want to handle questions regarding its use, in particular if it's involving old versions of PhantomJS. If you don't want to branch/fork this project, please use other approaches, e.g. writing a blog post or an article. Many good external articles are mentioned from https://github.com/ariya/phantomjs/wiki/Buzz. Closing this issue as WONTFIX. |
Thank you. Created a How-To article in our blog |
Added both to Buzz. |
I have been using PhantomJS for 3 years; version 1.9 randomly dies when creating lots of pdfs. Otherwise, it's been a great product for us. The suggested fix for this problem was 2+. Upon installing 2.1.1, I immediately ran into the issue of the zoomFactor not working at all/really huge pdfs that don't fit to A4 pages. So I pulled master and tried to compile on Ubuntu 16.0.4 with 9GB free storage and 7.5 GB RAM. It fails every time with I have xcb installed. I have tried modifying the build.py script to add -no-qpa-platform-guard. That will compile for awhile and then die at ERROR: Failed to build PhantomJS! Building Qt Base failed. I will pay cash money for someone who can get me a build on Ubuntu 16.0.4 that 1) dies less often and 2) does not have this zoomfactor/dpi problem. Thoughts? What am I doing wrong? |
@ariya @JamesMGreene Hello all! I have spent the last couple of weeks testing various platforms and open-source screenshot utilities to consider adding a failover or fallback for our primary capture technology. I have been testing with Chrome, Firefox, PhantomJS, CutyCapt, and I'm now considering to test SlimerJS (since it appears to support Flash). My question for you is: "While I understand removing Flash support to greatly decouple dependencies and simplify development and maintanence, I read somewhere that the argument was this allows for externally supplied support. However, I do not see any documentation or mention of how one would integrate a Flash-support integration with PhantomJS that does not require constantly cross-porting (a word?) changes. So, could you elaborate on that a bit or clarify any misunderstanding I have in that?" Without Flash, I cannot consider PhantomJS at all, which is sad b/c PhantomJS runs nearly twice as fast as my current, proprietary solution! The forks that add back Flash support, being unsupported, outdated, and cumbersome, would only add to my already overloaded code maintenance plate. Thank you for any feedback and insight! :) |
Hello. Yes, I understand that 1.4.1 is out of support, but it is the latest version which supports Flash, so this may be useful to other community members.
System: CentOS release 5.7 (Final), 32bit
I've installed all the components by these guides
http://rhythmicalmedia.com/?p=146
https://code.google.com/p/phantomjs/wiki/XvfbSetup
All was OK (except the GIT insallation - but phantomjs-1.4.1 was in source code, so no actual usage of GIT).
Xvfb has been started (also need to add strings
to make chkconfig work with it).
I'm trying to lauch just loadspeed.js from examples (as command line for Xvfb tells) - under root:
What also need to be compiled / installed?
The text was updated successfully, but these errors were encountered: