validateOptions()

in lib/websandbox.ts [106:114]


  validateOptions(options: Partial<SandboxOptions>) {
    if (options.frameSrc && (options.frameContent || options.initialStyles || options.baseUrl || options.codeToRunBeforeInit)) {
      throw new Error('You can not set both "frameSrc" and any of frameContent,initialStyles,baseUrl,codeToRunBeforeInit options');
    }

    if ('frameContent' in options && !options.frameContent?.includes('<head>')) {
      throw new Error('Websandbox: iFrame content must have "<head>" tag.');
    }
  }