forked from comit-network/waves
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Directly return errors from background script to in-page script
The listener in `browser.runtime.onMessage.addListener` can handle promises. As such, we can directly _reject_ this promise if there is any error in invoking the various wallet functions. Such a rejected promise is then _caught_ inside the content script and forwarded as an event to the in-page script. The communication of the events between in-page script and content-script has been reworked. 1. The new implementation contains less duplicated code due to the use of a generic `invokeContentScript` function. 2. Every request is tagged with an ID which allows us to uniquely identify, which particular request failed. This should help with race conditions where the same event is fired multiple times. Related: comit-network#196.
- Loading branch information
1 parent
4bca80d
commit 831e4cb
Showing
11 changed files
with
264 additions
and
388 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.