Location.reload() crashes photoshop (PS version 23.2.x)

Hey everyone,
whenever I use location.reload() or windlow.location.reload()… Photoshop crashes starting from version 23.2. It doesn’t matter whether the user is using Windows or MAC.

In version 23.2.1 the problem occurred only when a was open. Meanwhile always when I use the command.

Is this a known problem? Can anyone confirm this?

“windlow.location.reload()” appears to have a spelling error.

I use “document.location.reload();” without problems.

When the plugin loads, do you you do things like populate text fields or something. Maybe it’s something that the plugin does in this regard.

Thank you for your answer.
The spelling mistake happened to me only here :).

Unfortunately, it still does not work.
As soon as I open a and call one of the following functions;
location.reload()
window.location.reload()
document.location.reload()

Photoshop crashes. Even if I set my plugin to “watch” in the Developer Tool… call the function in Photoshop in the plugin… and save my project in my programming editor, so that the Developer Tool does the reload… unfortunately Photoshop crashes too.

The problem is with me and my beta testers who only use the plugin in Photoshop.

When I start the plugin, only a .json file is loaded. Text fields or buttons are not executed at startup.

The problem only occurs when I have a open in the plugin. in 23.1 this problem has not existed so far.

I think you’re missing a word here. A [what] open?

What happens if you don’t load the .json file?

hm… the editor here has converted it as HTML tag…
“when I opened the < dialog > function / tag”.

Do you have only one dialog open when you do a reload or more?

Yes, there is only one dialog open.
I also just created a completely new plugin with only one dialog. Without json files and without other functions.

So completely empty…
The same problem occurs… since Photoshop 23.2.x

I just tested my plugin I’m currently developing with Ps v23.2.2 and v23.3 - no issues at all even with multiple dialogs open at the same time.

Could you share the code of that empty dialog plugin that crashes? I have it’s not empty and you have an endless loop somewhere in there :confused:

index.html

<!DOCTYPE html>
<html>
<head>
    <script src="index.js"></script>    
</head>
<body>

  <dialog id="setName">
    <div>
      Test
    </div>
  </dialog>

</body>
</html>

index.js


  const res = document.querySelector("#setName").uxpShowModal( 
      {
      title: "title",
      resize: "both",
      size: {
      width: 464,
      height: 250
      }
  })

Bildschirmfoto 2022-03-20 um 09.31.29

This is my complete project.
No loops or functions :frowning:

What’s in manifest? Now it looks like you’re opening a dialog as soon as plugin loads

Yes, I open it directly after loading. But only here in the test plugin.
The manifest.json is the one that is automatically created by the developer tool.

{
  "id": "dialogtest",
  "name": "Test",
  "version": "1.0.0",
  "main": "index.html",
  "host": [
    {
      "app": "PS",
      "minVersion": "22.0.0"
    }
  ],
  "manifestVersion": 4,
  "entrypoints": [
    {
      "type": "panel",
      "id": "vanilla",
      "minimumSize": {
        "width": 230,
        "height": 200
      },
      "maximumSize": {
        "width": 2000,
        "height": 2000
      },
      "preferredDockedSize": {
        "width": 230,
        "height": 300
      },
      "preferredFloatingSize": {
        "width": 230,
        "height": 300
      },
      "icons": [
        {
          "width": 32,
          "height": 32,
          "path": "icons/icon_D.png",
          "scale": [
            1,
            2
          ],
          "theme": [
            "dark",
            "darkest"
          ],
          "species": [
            "generic"
          ]
        },
        {
          "width": 32,
          "height": 32,
          "path": "icons/icon_N.png",
          "scale": [
            1,
            2
          ],
          "theme": [
            "lightest",
            "light"
          ],
          "species": [
            "generic"
          ]
        }
      ],
      "label": {
        "default": "Starter Panel"
      }
    }
  ],
  "icons": [
    {
      "width": 23,
      "height": 23,
      "path": "icons/dark.png",
      "scale": [
        1,
        2
      ],
      "theme": [
        "darkest",
        "dark",
        "medium"
      ]
    },
    {
      "width": 23,
      "height": 23,
      "path": "icons/light.png",
      "scale": [
        1,
        2
      ],
      "theme": [
        "lightest",
        "light"
      ]
    }
  ]
}

Don’t know what to suggest. Just tried on Win10 Ps v23.2.2 and it does what it’s supposed to do and nothing crashes or freezes :thinking: Do you have maybe some preview features enabled?

No, not that I know…. :frowning:

Hello all,

am I really the only one who has this problem?
No matter where I place a reload… as soon as a is open… Photoshop crashes.

No one else having this problem?

Hello,

can you test this plugin once?
Load, start and click the button…

After that Photohop crashes, right?

Test.zip (9.4 KB)

@Rick confirming the crash - Windows 10, PS 23.2.2

1 Like

Didn’t try yet, but I suspect it’s because you try to reload with dialog open. Can you try changing to something like:

const dialog = document.querySelector("#modal");

dialog.uxpShowModal({
  title: "Hier kannst du deine Buttons konfigurieren",
  resize: "both", // "both", "horizontal", "vertical",
  size: {
    width: 1350
  }
});


document.getElementById("btnreload").addEventListener("click", () => {
  dialog.close();    
  location.reload();
})

Edit: Just tried and it crashes

OK, so this works:

const dialog = document.querySelector("#modal");

dialog.uxpShowModal({
  title: "Hier kannst du deine Buttons konfigurieren",
  resize: "both", // "both", "horizontal", "vertical",
  size: {
    width: 1350
  }
});


document.getElementById("btnreload").addEventListener("click", () => {
  dialog.close();    
  setTimeout(() => window.location.reload(), 1000);
})

But if you try to reload it from UDT with dialog open, then it crashes. If you close the dialog and then reload from UDT, all is fine. I believe Ps goes into some kind of loop if there’s no timeout on reload and dialog opens instantly…

Ping @kerrishotts

1 Like

i think the new version of photoshop fix this issue.
Everything is working fine now!
v. 23.3.0 :champagne:

@Karmalakas @AnthonyK @Timothy_Bennett

1 Like