@lincyaw/kernel 1.0.0-rc.4 → 1.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/preview-frame.ts +5 -2
package/package.json
CHANGED
package/src/preview-frame.ts
CHANGED
|
@@ -126,9 +126,12 @@ export function previewAppearance(): 'dark' | 'light' | undefined {
|
|
|
126
126
|
return given === 'dark' || given === 'light' ? given : undefined
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* The Content-Security-Policy that lets only the site itself and the workbench's origins embed a page: a home page
|
|
131
|
+
* that plays a document's presentation in a frame works in `presmium serve` as it does in the built site.
|
|
132
|
+
*/
|
|
130
133
|
export function previewFrameAncestors(origins: readonly string[]): string {
|
|
131
|
-
return
|
|
134
|
+
return ['frame-ancestors', "'self'", ...origins].join(' ')
|
|
132
135
|
}
|
|
133
136
|
|
|
134
137
|
/** Whether the page is embedded by a workbench as its preview (the frame may still be refused when no origin is allowed). */
|