Embed Jupyterlab into an iframe

#1

Hey guys, I’m trying to embed a jupyterlab instance into an iframe in my website.

This is the iframe in my website:

<body>
   <iframe src='http://localhost:8888' />
</body>

I’ve also added tornado_settings to the etc\jupyter\jupyter_notebook_config.d\jupyterlab.json file.

{
  "NotebookApp": {
    "nbserver_extensions": {
      "jupyterlab": true
    },
	"tornado_settings": {
    	"headers": {
         "Content-Security-Policy": "frame-ancestors self http://localhost:4200"
    	}
	}
  }
}

but I keep getting the error:

Refused to display 'http://localhost:8888/lab?' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".

Am I missing something?

Thanks in advance.

0 Likes