dockview-core 6.1.1 → 6.2.1
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/dist/cjs/popoutWindow.d.ts +7 -0
- package/dist/cjs/popoutWindow.js +21 -0
- package/dist/dockview-core.js +21 -1
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.js.map +1 -1
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.min.noStyle.js.map +1 -1
- package/dist/dockview-core.noStyle.js +21 -1
- package/dist/esm/popoutWindow.d.ts +7 -0
- package/dist/esm/popoutWindow.js +20 -0
- package/dist/package/main.cjs.js +21 -1
- package/dist/package/main.cjs.min.js +2 -2
- package/dist/package/main.esm.min.mjs +2 -2
- package/dist/package/main.esm.mjs +21 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 6.
|
|
3
|
+
* @version 6.2.1
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -11533,6 +11533,25 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
11533
11533
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
11534
11534
|
};
|
|
11535
11535
|
|
|
11536
|
+
/**
|
|
11537
|
+
* Reject popout URLs that aren't same-origin http(s). Blocks `javascript:`,
|
|
11538
|
+
* `data:`, `blob:`, `vbscript:`, and cross-origin URLs that would otherwise
|
|
11539
|
+
* execute in a context the browser still associates with the opener via
|
|
11540
|
+
* `window.opener`.
|
|
11541
|
+
*/
|
|
11542
|
+
function assertSameOriginPopoutUrl(url) {
|
|
11543
|
+
let resolved;
|
|
11544
|
+
try {
|
|
11545
|
+
resolved = new URL(url, window.location.href);
|
|
11546
|
+
}
|
|
11547
|
+
catch (_a) {
|
|
11548
|
+
throw new Error(`dockview: invalid popout URL: ${url}`);
|
|
11549
|
+
}
|
|
11550
|
+
const protocolOk = resolved.protocol === 'http:' || resolved.protocol === 'https:';
|
|
11551
|
+
if (!protocolOk || resolved.origin !== window.location.origin) {
|
|
11552
|
+
throw new Error(`dockview: popout URL must be same-origin http(s); got: ${url}`);
|
|
11553
|
+
}
|
|
11554
|
+
}
|
|
11536
11555
|
class PopoutWindow extends CompositeDisposable {
|
|
11537
11556
|
get window() {
|
|
11538
11557
|
var _a, _b;
|
|
@@ -11584,6 +11603,7 @@ class PopoutWindow extends CompositeDisposable {
|
|
|
11584
11603
|
throw new Error('instance of popout window is already open');
|
|
11585
11604
|
}
|
|
11586
11605
|
const url = `${this.options.url}`;
|
|
11606
|
+
assertSameOriginPopoutUrl(url);
|
|
11587
11607
|
const features = Object.entries({
|
|
11588
11608
|
top: this.options.top,
|
|
11589
11609
|
left: this.options.left,
|