summaryrefslogtreecommitdiff
path: root/ext/js/pages/settings
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/pages/settings')
-rw-r--r--ext/js/pages/settings/popup-preview-controller.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/js/pages/settings/popup-preview-controller.js b/ext/js/pages/settings/popup-preview-controller.js
index 4a09d169..da163a6a 100644
--- a/ext/js/pages/settings/popup-preview-controller.js
+++ b/ext/js/pages/settings/popup-preview-controller.js
@@ -112,3 +112,11 @@ export class PopupPreviewController {
this._frame.contentWindow.postMessage({action, params}, this._targetOrigin);
}
}
+
+/**
+ * @param {string | undefined} url
+ * @returns {boolean}
+ */
+export function checkPopupPreviewURL(url) {
+ return !!(url && url.includes('popup-preview.html') && !['http:', 'https:', 'ws:', 'wss:', 'ftp:', 'data:', 'file:'].includes(new URL(url).protocol));
+}