summaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js29
1 files changed, 11 insertions, 18 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index 2a9670fc..b5eb9fe2 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -90,6 +90,13 @@ class Popup {
this.updateTheme();
}
+ async showContent(elementRect, writingMode, type=null, details=null) {
+ if (!this.isInitialized()) { return; }
+ await this.show(elementRect, writingMode);
+ if (type === null) { return; }
+ this.invokeApi('setContent', {type, details});
+ }
+
async show(elementRect, writingMode) {
await this.inject();
@@ -218,12 +225,6 @@ class Popup {
return [position, size, after];
}
- async showOrphaned(elementRect, writingMode) {
- if (!this.isInitialized()) { return; }
- await this.show(elementRect, writingMode);
- this.invokeApi('orphaned');
- }
-
hide(changeFocus) {
if (!this.isVisible()) {
return;
@@ -238,6 +239,10 @@ class Popup {
}
}
+ async isVisibleAsync() {
+ return this.isVisible();
+ }
+
isVisible() {
return this.isInjected && (this.visibleOverride !== null ? this.visibleOverride : this.visible);
}
@@ -320,18 +325,6 @@ class Popup {
return false;
}
- async termsShow(elementRect, writingMode, definitions, context) {
- if (!this.isInitialized()) { return; }
- await this.show(elementRect, writingMode);
- this.invokeApi('termsShow', {definitions, context});
- }
-
- async kanjiShow(elementRect, writingMode, definitions, context) {
- if (!this.isInitialized()) { return; }
- await this.show(elementRect, writingMode);
- this.invokeApi('kanjiShow', {definitions, context});
- }
-
async setCustomCss(css) {
this.invokeApi('setCustomCss', {css});
}