inspect icon indicating copy to clipboard operation
inspect copied to clipboard

Document on how to integrate in electron apps

Open iongion opened this issue 1 year ago • 2 comments

Leaving this as a guide for the next soul trying it.

const URLS_ALLOWED = [
  "https://stately.ai/inspect",
  "https://stately.ai/registry/inspect",
  "http://localhost",
];
const DOMAINS_ALLOW_LIST = ["localhost"];

applicationWindow.webContents.setWindowOpenHandler((event: any) => {
  const info = new URL(event.url);
  if (!URLS_ALLOWED.includes(event.url)) {
      if (!DOMAINS_ALLOW_LIST.includes(info.hostname)) {
        logger.error("Security issue - attempt to open a domain that is not allowed", info);
        return { action: "deny" };
      }
  }
  return { action: "allow" };
});

iongion avatar Aug 27 '24 19:08 iongion

Still did not work with me although it opens external web window but it sticks at Use the [@statelyai/inspect](https://github.com/statelyai/inspect) package to inspect live XState code.. I am using nodeIntegration: false, contextIsolation: true,

drahmedshaheen avatar Jan 13 '25 13:01 drahmedshaheen

Still did not work with me although it opens external web window but it sticks at Use the [@statelyai/inspect](https://github.com/statelyai/inspect) package to inspect live XState code.. I am using nodeIntegration: false, contextIsolation: true,

i have the same issue.

@iongion could there be any configuration that we might have missed?

aishahsofeaxsolla avatar Jan 14 '25 06:01 aishahsofeaxsolla