sculptui-vscode
Version:
Visually edit your React component code from the browser
37 lines (35 loc) • 1.08 kB
text/typescript
export function getWebviewContent(targetUrl: string) {
return `
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cat Coding</title>
<style type="text/css">
body {
margin: 0;
overflow: hidden;
}
#content-iframe {
position:absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
border: 0;
background-color: white;
}
</style>
<script>
</script>
</head>
<body>
<iframe id="content-iframe" sandbox="allow-same-origin allow-scripts" src="${targetUrl}" frameBorder="0" width="100%" height="100%"></iframe>
<script>
/*const iFrame = document.getElementById('content-iframe');
console.log(iFrame);
setTimeout( () => {console.log("setting url now"); iFrame.src = "${targetUrl}";}, 5000 );*/
</script>
</body>
</html>`;
}