Big Updates Coming to UXP

Webview, UXP Scripting, C++ Hybrid Plugins, and more.

Padma Krishnamoorthy
Adobe Tech Blog

--

Editor’s Note: Welcome Padma Krishnamoorthy, a Technical Product Manager at Adobe to the Tech Blog, and to the Creative Cloud Developer Platform team!
— Erin Finnegan, Community Engineer, Creative Cloud.

Hi! I’m Padma Krishnamoorthy, a Technical Product Manager for UXP, who’s been at Adobe for more than four years. Before that I worked as a web developer using popular Javascript libraries and frameworks such as Angular and ReactJS. My current work involves focusing on in-app extensibility using UXP in Creative Cloud.

This post is for current developers of UXP plugins, and developers who are looking to migrate their plugins to UXP.

We have exciting updates for you to check out in UXP version 6. The following new features are out in Photoshop Beta 23.3 now:

  • Webview
  • Manifest v5
  • V8 upgrade to v9.4.146.24
  • Launch apps

The follow feature are coming soon, tentatively scheduled for June, 2022:

  • Hybrid C++ plugins
  • UXP Scripting
  • File operation enhancements
Repeated pattern of UXP Developer Tool icon.

Which version of UXP am I on?

Each host app has a separate release cycle. Therefore, the UXP version will vary by app. The easiest way to tell which version of UXP you are on is via the Adobe UXP Developer Tool (UDT). (UDT is available in the Creative Cloud desktop app if you don’t have it already.)

First, make sure the target application is running. Then, go to ‘Connected apps’ in UDT. You will be able to see the app and UXP version for each connected app.

A snapshot of UDT showing app and UXP version for each connected app.

Programmatically, you can find the version in your plugin by using this command:

require("uxp").versions.uxp;

UXP Version by Host App

If you’re not in the Photoshop Prerelease 2.0, you can join the Photoshop prerelease by emailing us.

The XD private prerelease has been discontinued, however, XD Beta releases are now available in the Creative Cloud desktop app.

UXP 6 New Features; Available Now in Beta

V8 upgrade

UXP 6 has upgraded its V8 engine to v9.4.146.24.

Webview

Webview in UXP is now available in Photoshop Beta (23.3). Thank you for your patience! You can try it out by following these very simple steps:

  1. Enable webview and domains in your plugin’s manifest:

2. Use webview:

…yes its that easy! You have a modal dialog using webview.

Here are some things to keep in mind:

  • Webview is only available within modal dialogs for now.
  • You must use Manifest v5 to use webview. (More on that in the next section).
  • Only remote content (including localhost) is allowed at present.

Launch Apps

In UXP 6.0.2 manifest v5 enables the ability to launch apps using their URI scheme. See the launchProcess section below.

Manifest v5

Upgrade to manifest v5 to unlock new features in UXP including webview, hybrid C++ plugins, and enhanced security.

What do you need to do to update?

First, update the “manifestVersion” . Changing the value of the manifestVersion element is the key to upgrading your plugin. This determines whether you’re using the MV4 or MV5 feature set:

V4 →

"manifestVersion": 4

V5 →

"manifestVersion": 5

Second, update the host minVersion. Photoshop minVersion in your manifest should be at least 23.3.0. (Manifest v5 plugins do not support earlier versions of Photoshop)

"host": {
"app": "PS",
"minVersion": "23.3"
}

Next, your plugin will require the correct permission entry in its manifest.

Please note that with the new permissions model, users will be asked for their consent when your plugin attempts to use openExternal, openPath, and sp-link/anchor tags. For everything else, consent is assumed given at install time.

Below are few examples of the permissions you would need to unlock UXP modules in v5:

network — allowed values for domains: string[], “all”

clipboard — allowed values: “readAndWrite”, “read”

localFileSystem — allowed values: “plugin”, “request” and “fullAccess”

launchProcess — allowed value for schemes and extensions: string[]

Make sure you change “launchProcess”: “request” from manifest v4 to the new signature.

allowCodeGenerationFromStrings — allowed values: true, false

ipc.enablePluginCommunication — allowed values: true, false

Pro-tip: Add only the absolutely required permission for your plugin to make it work efficiently.

Keep in mind while publishing your plugins with manifest v5 that if you distribute through the Exchange Marketplace, it will not attempt to deliver an older version of the plugin. Also, the users who have not previously installed your plugin must use Photoshop 23.3.0 or higher in order use your upgraded plugin.

Also note that the plugins built with v4 manifests will continue to work in Photoshop 23.3, but won’t be able to benefit from the new features enabled in v5.

Coming soon

The following new features are next in the queue for UXP.

  • Support for Hybrid C++ plugins
  • UXP Scripting
  • Process data in chunks

Support for Hybrid C++ plugins

Hybrid plugins combine the best of both worlds: A single plugin may use both native code and UXP UI elements. You can keep the highly CPU-intensive computations in native code and have a UI built in UXP — all distributed under a single bundle. You will no longer need to maintain separate distribution channels for native modules and UXP UI.

Your plugin can extend its functionality by making use of helper libraries, which are developed native module that can inject various APIs into the plugin’s JS context.

The installation process will be automated and simplified for hybrid plugins. For example, image filter within your plugin will be installed automatically. The user will not have to perform manual steps to make your plugin work.

UXP Scripting

Coming soon to Photoshop: Standalone scripts written in (modern) Javascript that will allow you to automate tasks by leveraging UXP features! You will be able to use UXP modules like localFileSystem, launchProcess etc similar to plugins, using only a script! Communicate back and forth with the host app by receiving arguments and sending back data as a result of execution.

File operations enhancement

Currently, file or network operations for large files leave a big memory footprint. We will soon release streaming abilities (based on web Streams API). You will be able to process data in chunks resulting in much less memory use. Plus, you’ll be able to create, combine, consume and customize streams over UXP.

Try it today!

Try out modal webview and manifest v. 5 in beta and let us know what you think in the UXP developer forums.

For more stories like this, subscribe to our Creative Cloud Developer Newsletter.

--

--