Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webextension: handler for runtime messages now returns a promise #413

Merged
merged 3 commits into from Jan 16, 2020

Conversation

remusao
Copy link
Collaborator

@remusao remusao commented Jan 16, 2020

Fixes #387

Handling of runtime messages involves asynchronous operations (e.g. injection of stylesheets in frames) which are currently not tied to the return value of the handler. This causes two issues:

  • The caller cannot wait for a runtime message to be handled.
  • If an error occurs, then we cannot inform the caller (and instead a console.error is shown).

This PR changes the behavior so that handling of runtime messages returns a promise which can fail. Moreover, different cases of failure now trigger custom error messages so that caller knows why errors are thrown.

@remusao remusao merged commit 8bb8dc4 into ghostery:master Jan 16, 2020
@remusao remusao added the PR: Polish 💅 Increment patch version when merged label Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Polish 💅 Increment patch version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

catch rejection from chrome. methods
1 participant