Fix error handling on style injection

This commit is contained in:
toasted-nutbread 2020-02-16 21:49:28 -05:00
parent e173a71ba6
commit ae4ee9ddee

View File

@ -219,15 +219,24 @@ class Popup {
}); });
this._observeFullscreen(true); this._observeFullscreen(true);
this._onFullscreenChanged(); this._onFullscreenChanged();
try { this._injectStyles();
Popup._injectStylesheet('yomichan-popup-outer-stylesheet', 'file', '/fg/css/client.css', true);
this.setCustomOuterCss(this._options.general.customPopupOuterCss, true);
} catch (e) {
// NOP
}
}); });
} }
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) { _observeFullscreen(observe) {
if (!observe) { if (!observe) {
this._fullscreenEventListeners.removeAllEventListeners(); this._fullscreenEventListeners.removeAllEventListeners();