diff --git a/app/core/InpageBridge.js b/app/core/InpageBridge.js index 91b802bbd4c..9f28e244cd6 100644 --- a/app/core/InpageBridge.js +++ b/app/core/InpageBridge.js @@ -289,6 +289,18 @@ class InpageBridge { this.events[event].push(listener); } + /** + * Simulate the once event to keep parity with the EventEmitter interface + * because there are some dapps that use it + * + * @param {string} event - Event name + * @param {Function} listener - Callback invoked when event triggered + * @returns {InpageBridge} + */ + once(event, listener) { + this.on(event, listener); + } + /** * Remove a listener for a specific event *