Does PhantomJS support ES6 for serving angularjs app to crawlers and bots?

廉价感情. 提交于 2019-12-05 23:31:23

问题


I am trying to use ajax-seo for an Angularjs app to serve html compiled content from a PhantomJS webserver`. But it's not rendering the complete page. It's just giving the following response

<html><head></head><body></body></html>

I have followed the instructions well but no luck so far. So I'd like to know whether PhantomJS supports ES6 or not, because my app is in ES6.


回答1:


PhantomJS 2.1.1 only supports about 10% of ECMAScript 6, which might not be enough to properly render your page.

Here is a slightly more detailed result based on https://kangax.github.io/compat-table/es6/:

Overall coverage: 10%
> Array is subclassable: 0/11
> Array static methods: 0/11
> Array.prototype methods: 0/10
> Date.prototype[Symbol.toPrimitive]: No
> Function is subclassable: 0/6
> HTML-style comments: Yes
> Map: 0/19
> Math methods: 1/17
> Number properties: 0/7
> Object static methods: 0/4
> Object static methods accept primitives: 0/10
> Object.prototype.__proto__: 6/6
> Promise: 0/8
> Promise is subclassable: 0/4
> Proxy: 0/34
> Proxy, internal 'defineProperty' calls: 0/2
> Proxy, internal 'deleteProperty' calls: 0/6
> Proxy, internal 'get' calls: 0/36
> Proxy, internal 'getOwnPropertyDescriptor' calls: 0/4
> Proxy, internal 'ownKeys' calls: 0/3
> Proxy, internal 'set' calls: 0/11
> Reflect: 0/20
> RegExp "y" and "u" flags: 0/5
> RegExp is subclassable: 0/4
> RegExp syntax extensions: 8/8
> RegExp.prototype properties: 0/6
> RegExp.prototype.compile: Yes
> Set: 0/19
> String static methods: 0/2
> String.prototype HTML methods: 3/3
> String.prototype methods: 0/10
> Symbol: 0/11
> Unicode code point escapes: 0/2
> WeakMap: 0/12
> WeakSet: 0/11
> __proto__ in object literals: 1/5
> arrow functions: 0/13
> block-level function declaration: No
> class: 0/24
> const: 1/16
> default function parameters: 0/7
> destructuring, assignment: 0/24
> destructuring, declarations: 0/22
> destructuring, parameters: 0/23
> for..of loops: 0/9
> function "name" property: 3/17
> generators: 0/27
> let: 0/12
> miscellaneous: 2/10
> miscellaneous subclassables: 0/6
> new.target: 0/2
> non-strict function semantics: 2/3
> object literal extensions: 0/6
> octal and binary literals: 0/4
> own property order: 4/7
> proper tail calls (tail call optimisation): 0/2
> prototype of bound functions: 0/5
> rest parameters: 0/5
> spread (...) operator: 0/15
> super: 0/8
> template literals: 0/5
> typed arrays: 19/46
> well-known symbols: 0/26

This Gist contains the full data as well as the script that generated it.



来源:https://stackoverflow.com/questions/37629774/does-phantomjs-support-es6-for-serving-angularjs-app-to-crawlers-and-bots

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!