HTML Link does not work

,

Hello.

I am currently developing a Script plug-in for Photoshop.

I’m not sure if this is an effect of the update, but the link to the web site that worked at first is no longer working.
The screenshot below is a pure link, but it is the same if I do it with supectrum’s .

スクリーンショット 2023-04-06 215421

I have tried putting the following in the manifest file, but it does not work.

スクリーンショット 2023-04-06 215454

Is there any other possible cause for this?

Translated with DeepL

I believe you need a launchProcess permission in manifest. But it says it’s for external apps, so I’m not sure :thinking:

1 Like

@Karmalakas

Thanks for the solution.

I see that there are some new additions from manifest v5.
I will try it once.

Thanks again.

Added Launch Process, but it did not work.

I tried the WebView listed on the same page,
but even though the window opened, the website was not displayed inside.

https://developer.adobe.com/photoshop/uxp/2022/guides/uxp_guide/uxp-misc/manifest-v5/#webviews

There is no sign of HTTP communication itself, so the process may have stopped somewhere in the first place.

I will continue to investigate.

No expert on this, but I thought you could only open web views inside a modal dialog window with UXP.

To open an external link, you can use something like:

const shell=require("uxp").shell;
shell.openExternal("https://www.youtube.com/@hideo3");

Again, not sure if that’s what you’re looking for, but this code could be used to open the URL in your computer’s default web browser.

1 Like

@AnthonyK

Hello.

I wanted to open the given URL in my browser to view the help video so I will try it once.

Thanks for giving me the solution.

I also looked at this one and tested it, but it did not work in my environment.

https://developer.adobe.com/photoshop/uxp/2022/uxp-api/reference-js/Modules/shell/Shell/

const shell = require(“uxp”).shell;

function callurl(){
console.log(“call URL”);
shell.openExternal(“URL”) —>The actual link is described here.
}

const click_link = document.getElementById(‘Youtube_link’);
click_link.addEventListener(‘click’,function(){
callurl();
})

I have also changed the manifest to v5, but I don’t know what is wrong. :thinking:

“manifestVersion”: 5,

I would like to see how it works for a while.

Thank you.

試してみましたが,"launchProcess": {"schemes": ["https"]}を指定したら動作しました。aタグやsp-linkのクリック,openExternalのどれも成功します。

I tried it and it works when using "launchProcess": {"schemes": ["https"]}. a-tag click, sp-link click, and openExternal all succeed.

Full text of manifest.json

{
  "id": "manifest-5-test",
  "name": "manifest-5-test",
  "version": "1.0.0",
  "main": "index.html",
  "manifestVersion": 5,
  "host": {
    "app": "PS",
    "minVersion": "23.3"
  },
  "requiredPermissions": {
    "launchProcess": {
      "schemes": ["https"]
    }
  },
  "icons": [
    {
      "width": 48, "height": 48, "path": "images/plugin.png", "scale": [ 1, 2 ],
      "theme": [ "darkest", "dark", "medium", "lightest", "light", "all" ],
      "species": [ "pluginList" ]
    }
  ],
  "entrypoints": [
    {
      "type": "panel",
      "id": "manifest-5-test",
      "label": {
        "default": "manifest-5-test"
      },
      "minimumSize": {"width": 230, "height": 100},
      "maximumSize": {"width": 230, "height": 294},
      "preferredDockedSize": {"width": 230, "height": 294},
      "preferredFloatingSize": {"width": 230, "height": 294},
      "icons": [
        {
          "width": 23, "height": 23, "path": "images/dark-panel.png", "scale": [ 1, 2 ],
          "theme": [ "darkest", "dark", "medium" ], "species": [ "chrome" ]
        }, {
          "width": 23, "height": 23, "path": "images/light-panel.png", "scale": [ 1, 2 ],
          "theme": [ "lightest", "light" ], "species": [ "chrome" ]
        }
      ]
    }
  ]
}
1 Like

So my initial suggestion to add launchProcess works after all? Why didn’t it work on the first try?

@sttk3

いつもアドバイスありがとうございます。
なんと…動きましたか…。
他の環境でテストしてみたいと思っていたので、非常に助かります。
という事は私の環境が怪しいですね。
セキュリティソフトなどでの通信遮断なども疑ってみたのですが、その様子も無さそうで…。

Photoshopから何も飛んでいなさそうなので一度クリーンな状態のデータでテストしてみます。

Thanks again for your advice.
What a surprise…it worked…
This is very helpful because I wanted to test it in another environment.
So my environment is suspect.
I suspected some security software or other means of blocking communication, but there seems to be no sign of that…

Nothing seems to be flying out of Photoshop, so I’ll test it once with clean data.

@Karmalakas

Hello.

As I mentioned above, I tested the launchProcess you showed me, but it did not work in my environment.

I’m confused. In this post you say it works successfully

Hi, sorry for the confusion, this is not my post.
This is @sttk3’s post.

OMG, I completely overlooked :sweat_smile: I feel so stupid now :joy: It’s me who’s sorry for the confusion :slight_smile:

1 Like

@Karmalakas

No, no, you have always been very helpful in giving me advice.
Please keep up the good work.

厳密に言えば,私はPreactで書いているのでまったく同じではありません。単にあなたのコードにエラーがある可能性もあります。

Strictly put, I am writing in Preact, so it is not exactly the same. It is possible that there is simply an error in your code.

My code

const { h } = require('preact') ;

const App = () => {
  const linkURL = 'https://www.youtube.com/@hideo3' ;

  return (
    <div>
      <div>
        <sp-link
          href={linkURL}
        >
          sp-link
        </sp-link>
      </div>

      <div>
        <a href={linkURL}>a</a>
      </div>

      <sp-button
        onClick={ () => {
          const shell=require('uxp').shell ;
          shell.openExternal(linkURL) ;
        } }
      >
        Open link
      </sp-button>
    </div>
  ) ;
} ;

module.exports = {
  App
} ;
1 Like

フレームワークなど、全然分かっていないので、
ひとまずシンプルにHTML、CSSとjavascriptしか使っていないのですが、
最初はmanifestなども特に変更していないのにリンクが機能していたので、
どの段階でおかしくなったのか確認をしてみたいと思います。

コードのサンプルまでありがとうございます。
こちらも動作するかテストさせてもらいます。

I don’t know anything about frameworks, etc,
I am using only HTML, CSS, and javascript for now,
I have not made any changes to manifest or anything, but the links were working at first,
I would like to check at what point things went wrong.

Thank you for the code sample.
I will test to see if it works as well.

hello.

@Karmalakas @sttk3

"launchProcess": {
  "schemes": ["https"]
}

I made a mistake in describing this section.

Before, just clicking on the URL launched the browser with nothing special,
Now I get a confirmation message asking if I want to allow it.

I will now be able to submit it to Adobe for review.

I will report back on the results of the review.

I really appreciate everyone’s help.

Could you put the link of the plugin.

1 Like

@haller

I am very sorry.

Because I had deployed unnecessary files together,
I have temporarily suspended the publication.

I am currently reapplying to Adobe.

I expect it will be approved and published within a day or two,
I am sorry, but please be patient.

Please visit the following page to view the link after it is published.

1 Like