| 214 | // Purely used in order to decode a base64 string into |
| 215 | // an image format, bypassing saving a file onto the guest's system |
| 216 | function getGuestImageHtml(content: string) { |
| 217 | return ` |
| 218 | <!doctype HTML> |
| 219 | <html> |
| 220 | <head> |
| 221 | <meta charset="utf-8" /> |
| 222 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 223 | <style type="text/css"> |
| 224 | body { |
| 225 | color: black; |
| 226 | background-color: var(--vscode-editor-background); |
| 227 | } |
| 228 | img { |
| 229 | position: absolute; |
| 230 | top:0; |
| 231 | bottom: 0; |
| 232 | left: 0; |
| 233 | right: 0; |
| 234 | margin: auto; |
| 235 | } |
| 236 | </style> |
| 237 | </head> |
| 238 | <body> |
| 239 | <img src = "data:image/png;base64, ${String(content)}"> |
| 240 | </body> |
| 241 | </html> |
| 242 | `; |
| 243 | } |
| 244 | |
| 245 | export async function shareServer(url: URL, name: string): Promise<vscode.Disposable> { |
| 246 | return liveSession.shareServer({ |