summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-16 21:49:28 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-16 21:49:28 -0500
commitae4ee9ddee0b791c1039595250db6106e66709fa (patch)
tree2da9c4e17b77ce0bf2ba8338e3fe301636667ffb /ext
parente173a71ba631533a2a0a64ffe4d8883d7300802e (diff)
Fix error handling on style injection
Diffstat (limited to 'ext')
-rw-r--r--ext/fg/js/popup.js21
1 files changed, 15 insertions, 6 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index dc538b02..59c46ab8 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -219,15 +219,24 @@ class Popup {
});
this._observeFullscreen(true);
this._onFullscreenChanged();
- try {
- Popup._injectStylesheet('yomichan-popup-outer-stylesheet', 'file', '/fg/css/client.css', true);
- this.setCustomOuterCss(this._options.general.customPopupOuterCss, true);
- } catch (e) {
- // NOP
- }
+ this._injectStyles();
});
}
+ async _injectStyles() {
+ try {
+ await Popup._injectStylesheet('yomichan-popup-outer-stylesheet', 'file', '/fg/css/client.css', true);
+ } catch (e) {
+ // NOP
+ }
+
+ try {
+ await this.setCustomOuterCss(this._options.general.customPopupOuterCss, true);
+ } catch (e) {
+ // NOP
+ }
+ }
+
_observeFullscreen(observe) {
if (!observe) {
this._fullscreenEventListeners.removeAllEventListeners();