How to automatically set gmail filter via chrome extension?

后端 未结 1 1555
终归单人心
终归单人心 2021-01-28 13:59

I would like to implement the following use case as a Chrome extension:

  • user visits gmail
  • exension checks current email body for a keyword
  • if a k
相关标签:
1条回答
  • 2021-01-28 15:01

    After more experimentation and reviving an older github project I found out that setting the filter for a logged in user can be achieved simply by issuing a specific POST message to gmail from the current session.

    I don't fully understand the parameters used in this request (if anyone has better information, please share), but I found a sample code which was greatly helpful.

    Second issue, widely discussed in gmail.js community, is that Gmail security policies will prevent you from injecting your own scripts. This is bypassed by method shown in this boilerplate project

    I compiled these solutions to solve my particular use case. Here is an example project with my solution, which should work out of the box - and when in doubt, see readme.

    0 讨论(0)
提交回复
热议问题