aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup-proxy.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-08-15 17:27:03 -0400
committerGitHub <noreply@github.com>2020-08-15 17:27:03 -0400
commitd5865db457ef6f96aa32662a8219fdf73478ae20 (patch)
tree8144a77e4172a32d74fec60f13817fc251b461f2 /ext/fg/js/popup-proxy.js
parenta9b16bd9379a881bb7b875a1e56bffbd78440a6a (diff)
Popup API refactor (#732)
* Simplify how parent/child are set * Remove unused public frameId property * Change use of getFrame * Simplify parent access * Use property for the container * Remove isProxy * Public function API parity * Public property API parity
Diffstat (limited to 'ext/fg/js/popup-proxy.js')
-rw-r--r--ext/fg/js/popup-proxy.js44
1 files changed, 40 insertions, 4 deletions
diff --git a/ext/fg/js/popup-proxy.js b/ext/fg/js/popup-proxy.js
index b4438f80..28f6b276 100644
--- a/ext/fg/js/popup-proxy.js
+++ b/ext/fg/js/popup-proxy.js
@@ -45,10 +45,30 @@ class PopupProxy extends EventDispatcher {
return null;
}
+ set parent(value) {
+ throw new Error('Not supported on PopupProxy');
+ }
+
+ get child() {
+ return null;
+ }
+
+ set child(value) {
+ throw new Error('Not supported on PopupProxy');
+ }
+
get depth() {
return this._depth;
}
+ get frameContentWindow() {
+ return null;
+ }
+
+ get container() {
+ return null;
+ }
+
// Public functions
async prepare() {
@@ -56,10 +76,6 @@ class PopupProxy extends EventDispatcher {
this._id = id;
}
- isProxy() {
- return true;
- }
-
setOptionsContext(optionsContext, source) {
return this._invokeSafe('setOptionsContext', {id: this._id, optionsContext, source});
}
@@ -109,6 +125,26 @@ class PopupProxy extends EventDispatcher {
return this._invokeSafe('setContentScale', {id: this._id, scale});
}
+ isVisibleSync() {
+ throw new Error('Not supported on PopupProxy');
+ }
+
+ updateTheme() {
+ return this._invokeSafe('updateTheme', {id: this._id});
+ }
+
+ async setCustomOuterCss(css, useWebExtensionApi) {
+ return this._invokeSafe('updateTheme', {id: this._id, css, useWebExtensionApi});
+ }
+
+ setChildrenSupported(value) {
+ return this._invokeSafe('updateTheme', {id: this._id, value});
+ }
+
+ getFrameRect() {
+ return new DOMRect(0, 0, 0, 0);
+ }
+
// Private
_invoke(action, params={}) {