Adobe-CEP / CEP-Resources

Tools and documentation for building Creative Cloud app extensions with CEP
https://www.adobe.io/apis/creativecloud/cep.html
1.62k stars 824 forks source link

ECMAScript version? #69

Closed undavide closed 8 years ago

undavide commented 8 years ago

Hi, I've just found by total chance that (Photoshop CC2015.5) supports some ECMAScript 6 features. E.g. I'm able to use in my JS let and const, or string interpolation. Not Object property shorthand, nor function default param values or destructuring assignment.

So... what kind of JS version does CEP7 actually support?!

Thank you very much! –Davide

meyer commented 8 years ago

@undavide semi-educated guess: CEP 7 supports whatever you could do in Chrome 41.0.2272.104.

I got that number from chrome embedded framework.framework inside the Photoshop CC 2015.5 application bundle:

/Applications/Adobe Photoshop CC 2015.5/Adobe Photoshop CC 2015.5.app/Contents/MacOS/CEPHtmlEngine.app/Contents/frameworks/chromium embedded framework.framework/Resources/Info.plist

The relevant lines:

<key>CFBundleShortVersionString</key>
<string>41.0.2272.104</string>

Compatible JS features can be found here: http://kangax.github.io/compat-table/es6/#chrome41 (make sure you tick the “Show obsolete platforms” box at the top of the page).

image

undavide commented 8 years ago

That definitely makes sense @meyer, thanks. Let's wait for an official confirmation before closing the issue.

yugguo commented 8 years ago

Yes, CEP 7 depends on Chromium 41.0.2272.104.

vipulkumar-dev commented 1 year ago

By typing navigator.userAgent in the console of debug tab you can see the actual version of Chrome something like that:

"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"

vipulkumar-dev commented 1 year ago

function getES() { var array = [] if (!Array.isArray) { return 3 } else if (!window.Promise) { return 5 } else if (!array.includes) { return 6 } else if (!"".padStart) { return 7 } else if (!Promise.prototype.finally) { return 8 } else if (!window.BigInt) { return 9 } else if (!Promise.allSettled) { return 10 } else if (!"".replaceAll) { return 11 } else if (!array.at) { return 12 } else { return 13 } }

var ecmascript = getES() var year = 1999 if (ecmascript !== 3) { year = ecmascript + 2009 } console.log("Version " + ecmascript + ", Year " + year)