summaryrefslogtreecommitdiff
path: root/ext/fg/js/popup-proxy.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-07-18 14:15:36 -0400
committerGitHub <noreply@github.com>2020-07-18 14:15:36 -0400
commitdac33e696145ad3c2cfe076a7fadc82c05732102 (patch)
tree06dff8bd7dd2d8ebad5a025cf71e2910b2af80d4 /ext/fg/js/popup-proxy.js
parentf9c76efea00ff62021119c4d0fcf414e8988be1d (diff)
Extension unload indication fix (#662)
* Remove unused function * Rename field * Change extensionUnloaded trigger function * Update how extension unloaded content is shown * Ignore certain errors caused by extension unload * Add _showExtensionUnloaded function * Wrap internals of updateOptions * Suppress errors caued by extension unload * Make the frontend trigger the popup's extensionUnloaded event
Diffstat (limited to 'ext/fg/js/popup-proxy.js')
-rw-r--r--ext/fg/js/popup-proxy.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/ext/fg/js/popup-proxy.js b/ext/fg/js/popup-proxy.js
index 352c5b34..09c184db 100644
--- a/ext/fg/js/popup-proxy.js
+++ b/ext/fg/js/popup-proxy.js
@@ -69,7 +69,11 @@ class PopupProxy extends EventDispatcher {
}
async isVisible() {
- return await this._invoke('isVisible', {id: this._id});
+ try {
+ return await this._invoke('isVisible', {id: this._id});
+ } catch (e) {
+ return false;
+ }
}
setVisibleOverride(visible) {
@@ -98,8 +102,12 @@ class PopupProxy extends EventDispatcher {
this._invoke('setCustomCss', {id: this._id, css});
}
- clearAutoPlayTimer() {
- this._invoke('clearAutoPlayTimer', {id: this._id});
+ async clearAutoPlayTimer() {
+ try {
+ await this._invoke('clearAutoPlayTimer', {id: this._id});
+ } catch (e) {
+ // NOP
+ }
}
setContentScale(scale) {