starter-kit icon indicating copy to clipboard operation
starter-kit copied to clipboard

iFrame Script Source URL

Open megabyte0x opened this issue 1 year ago • 0 comments

Disclaimer: I am not sure how important this issue is 😅

Problem

Currently, in the packages/utils/renderer/services/embed.ts the script src is constant that is, /js/iframe-resizer.js which do not work if NEXT_PUBLIC_BASE_URL is defined.

Potential Solution

Make the script.src dynamic with NEXT_PUBLIC_BASE_URL

const BASE_URL = process.env.NEXT_PUBLIC_BASE_URL || '';

script.src = BASE_URL == '' ? `/js/iframe-resizer.js` : `${BASE_URL}/js/iframe-resizer.js`;

megabyte0x avatar Jul 12 '24 12:07 megabyte0x