aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-09-30 21:12:26 -0400
committerGitHub <noreply@github.com>2021-09-30 21:12:26 -0400
commit52e4bc8e6a357d9553dc2da385cb8ed5e8db15e7 (patch)
tree34c1153738309809e81a39b4a7fcdf320a9771c4
parent19eb990aeb197f70a0cf46efdf9f2bdd6ed1d48c (diff)
Add disable-popup-preview option to the settings page (#1974)
-rw-r--r--ext/js/pages/settings/popup-preview-controller.js4
-rw-r--r--ext/settings.html2
2 files changed, 5 insertions, 1 deletions
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
diff --git a/ext/settings.html b/ext/settings.html
index a4619786..1c3dd065 100644
--- a/ext/settings.html
+++ b/ext/settings.html
@@ -1980,7 +1980,7 @@
<div class="content-right">
<div class="preview-sidebar"><div class="preview-sidebar-inner">
<div class="preview-frame-container">
- <iframe src="/popup-preview.html" class="preview-frame" id="popup-preview-frame"></iframe>
+ <iframe class="preview-frame" id="popup-preview-frame"></iframe>
</div>
</div></div>
</div>