# How to connect a customElement to a Message Filter custom action?

**URL:** <https://discourse.mozilla.org/t/how-to-connect-a-customelement-to-a-message-filter-custom-action/44796>\
**Category:** Add-ons\
**Created:** [September 8, 2019, 9:43am UTC](https://discourse.mozilla.org/t/how-to-connect-a-customelement-to-a-message-filter-custom-action/44796 "2019-09-08T09:43:42Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jasperB](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jasperB](https://discourse.mozilla.org/u/jasperB)\
**Post date:** [December 12, 2019, 9:15pm UTC](https://discourse.mozilla.org/t/how-to-connect-a-customelement-to-a-message-filter-custom-action/44796/3 "2019-12-12T21:15:11Z")

</div>

I think the way to go is to make a MailExtension (WebExtenion) that contains a WebExtension Experiment. From there, ChromeUtils.import(“resource:///modules/MailServices.jsm”) and MailServices.filters.addCustomAction where the argument is the custom action, that implements the nsIMsgFilterCustomAction interface.

An alternative route would be to mark the extension as legacy, but that will probably entail more work at the next TB release.

---

_[View the full topic](https://discourse.mozilla.org/t/how-to-connect-a-customelement-to-a-message-filter-custom-action/44796)._
