File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
apps/chrome-extension/src Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,10 @@ const initButtons = (): void => {
155
155
right,
156
156
bottom : startBottom + 2 * itemHeight ,
157
157
} ,
158
+ {
159
+ right,
160
+ bottom : startBottom + 3 * itemHeight ,
161
+ } ,
158
162
]
159
163
}
160
164
Original file line number Diff line number Diff line change @@ -95,8 +95,8 @@ const main = async () => {
95
95
96
96
previewWindow . document . title = 'Markdown Preview'
97
97
98
- // Wait until the new window’s document is ready
99
- previewWindow . onload = ( ) => {
98
+ // prepare markdown preview for document
99
+ const writeViewContent = ( ) => {
100
100
const doc = previewWindow . document
101
101
102
102
const style = doc . createElement ( 'style' )
@@ -127,6 +127,17 @@ const main = async () => {
127
127
doc . body . appendChild ( pre )
128
128
}
129
129
130
+ if (
131
+ previewWindow . document . readyState === 'complete' ||
132
+ document . readyState === 'interactive'
133
+ ) {
134
+ writeViewContent ( )
135
+ } else {
136
+ previewWindow . onload = ( ) => {
137
+ writeViewContent ( )
138
+ }
139
+ }
140
+
130
141
if ( tokens . length > 0 ) {
131
142
const isSuccess = await makePublicUrlEffective (
132
143
Object . fromEntries ( tokens ) as Record < string , string > ,
You can’t perform that action at this time.
0 commit comments