aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-16 13:48:06 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-16 21:46:13 -0500
commit9fd6ee382d35fb5fcfc3e6d0f4fab711b37b693e (patch)
tree40e5ac9a3c325a422188ab4377902e39682bc34f /ext/bg/js
parentd3aefdc4e3f78b87b99bff576137f530ac7ac163 (diff)
Create more generic function for injecting stylesheets
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/settings/popup-preview-frame.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/bg/js/settings/popup-preview-frame.js b/ext/bg/js/settings/popup-preview-frame.js
index 8c354bf7..e900d4e2 100644
--- a/ext/bg/js/settings/popup-preview-frame.js
+++ b/ext/bg/js/settings/popup-preview-frame.js
@@ -88,10 +88,9 @@ class SettingsPopupPreview {
// This simulates the stylesheet priorities when injecting using the web extension API.
const result = await this.popupSetCustomOuterCssOld.call(this.popup, ...args);
- const outerStylesheet = Popup.outerStylesheet;
const node = document.querySelector('#client-css');
- if (node !== null && outerStylesheet !== null) {
- node.parentNode.insertBefore(outerStylesheet, node);
+ if (node !== null && result !== null) {
+ node.parentNode.insertBefore(result, node);
}
return result;