This repository was archived by the owner on May 10, 2024. It is now read-only.
File tree 2 files changed +19
-2
lines changed
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ export function configEditor() {
64
64
65
65
commands . registerCommand ( 'slidev.goto' , async ( idx : number ) => {
66
66
revealSlide ( idx )
67
+ previewProvider . updateSlide ( idx )
67
68
} )
68
69
69
70
commands . registerCommand ( 'slidev.next' , async ( ) => {
Original file line number Diff line number Diff line change @@ -116,11 +116,27 @@ code {
116
116
http-equiv="Content-Security-Policy"
117
117
content="default-src * 'unsafe-inline' 'unsafe-eval'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src *; style-src * 'unsafe-inline';"
118
118
/>
119
+ <style>
120
+ body {
121
+ padding: 0;
122
+ width: 100vw;
123
+ height: 100vh;
124
+ }
125
+ iframe {
126
+ border: none;
127
+ width: 100%;
128
+ height: 100%;
129
+ }
130
+ </style>
119
131
<head>
120
132
<body>
133
+ <iframe id="iframe" src="${ url } "></iframe>
121
134
<script>
122
- window.addEventListener('load', () => {
123
- location.replace(${ JSON . stringify ( url ) } )
135
+ var iframe = document.getElementById('iframe')
136
+ window.addEventListener('message', ({ data }) => {
137
+ if (data && data.target === 'slidev') {
138
+ iframe.contentWindow.postMessage(data, '${ serverAddr } ')
139
+ }
124
140
})
125
141
</script>
126
142
</body>
You can’t perform that action at this time.
0 commit comments