From 52e4bc8e6a357d9553dc2da385cb8ed5e8db15e7 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Thu, 30 Sep 2021 21:12:26 -0400 Subject: Add disable-popup-preview option to the settings page (#1974) --- ext/js/pages/settings/popup-preview-controller.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ext/js/pages/settings') diff --git a/ext/js/pages/settings/popup-preview-controller.js b/ext/js/pages/settings/popup-preview-controller.js index 170d56de..2a47d385 100644 --- a/ext/js/pages/settings/popup-preview-controller.js +++ b/ext/js/pages/settings/popup-preview-controller.js @@ -26,6 +26,8 @@ class PopupPreviewController { } async prepare() { + if (new URLSearchParams(location.search).get('popup-preview') === 'false') { return; } + this._frame = document.querySelector('#popup-preview-frame'); this._customCss = document.querySelector('#custom-popup-css'); this._customOuterCss = document.querySelector('#custom-popup-outer-css'); @@ -37,6 +39,8 @@ class PopupPreviewController { this._customOuterCss.addEventListener('settingChanged', this._onCustomOuterCssChange.bind(this), false); this._frame.addEventListener('load', this._onFrameLoad.bind(this), false); this._settingsController.on('optionsContextChanged', this._onOptionsContextChange.bind(this)); + + this._frame.src = '/popup-preview.html'; } // Private -- cgit v1.2.3