Skip to content

A Chrome Extension, send link, image or selected text to webhooks by filters

License

Notifications You must be signed in to change notification settings

ejfn/send-to-webhook

Repository files navigation

This project has been deprecated. Google no longer accept manifest v2 and the current version in the Chrome web store will be removed at sometime. Unforturately I cannot make any time to maintain this. If anyone is interested, feel free to fork and keep it going. Sorry for the inconvenience to the existing users.

Send To WebHook

A Chrome Extension, send link, image or selected text to webhooks by filters

See Extension Page

How to Configure

Simply paste your json config into Options page and save.

Sorry for no editor, I will make one when I have time.

The JSON config is a list of config which defines page/link matching rules and WebHook definition:

Field name Required Description
name Required The name of the webhook, will be displayed in the context menu title.
documentUrlPatterns Optional Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. For details on the format of a pattern, see Match Patterns.
targetUrlPatterns Optional Similar to documentUrlPatterns, but lets you filter based on the src attribute of img tags and the href of anchor tags. If not provided, the item will be applied to selected text.
action Required Lets you define webhook endpoint.
action.method Optional Default POST.
action.url Required The url of the webhook
action.payload Optional The json payload of the webhook data. You can use following templates to do some simple payload composing
action.headers Optional Http headers for the request
Templates
%s selected text
%d current date time in ISO format
%l current date time in Locale format

Example 1

Send selected text to my slack's #random channel

[
  {
    "name": "MySlack#random",
    "action": {
      "url": "<YOUR-SLACK-CHANNELS-INCOMING-WEBHOOK-URL>",
      "payload": {
        "text": "%s"
      }
    }
  }
]

Example 2

I want to grab a matched .ipa or .apk link from Expo's build page, and send to Bitrise triggering a job to upload build assets to TestFlight or PlayStore. (because Expo doesn't support build webhook, not yet)

[
  {
    "name": "Bitrise iOS Upload",
    "targetUrlPatterns": [
      "https://*.amazonaws.com/ios%2F%40username%2Ftestapp-*-archive.ipa"
    ],
    "action": {
      "url": "https://app.bitrise.io/app/xxxxxxxxxx/build/start.json",
      "payload": {
        "hook_info": {
          "type": "bitrise",
          "api_token": "<BITRISE_API_TOKEN>"
        },
        "build_params": {
          "workflow_id": "ios"
        },
        "environments": [
          {
            "mapped_to": "IPA_URL",
            "value": "%s",
            "is_expand": true
          }
        ],
        "triggered_by": "send-to-webhook"
      }
    }
  },
  {
    "name": "Bitrise Android Upload",
    "targetUrlPatterns": [
      "https://*.amazonaws.com/android%2F%40username%2Ftestapp-*-signed.apk"
    ],
    "action": {
      "url": "https://app.bitrise.io/app/xxxxxxxxxx/build/start.json",
      "payload": {
        "hook_info": {
          "type": "bitrise",
          "api_token": "<BITRISE_API_TOKEN>"
        },
        "build_params": {
          "workflow_id": "android"
        },
        "environments": [
          {
            "mapped_to": "APK_URL",
            "value": "%s",
            "is_expand": true
          }
        ],
        "triggered_by": "send-to-webhook"
      }
    }
  }
]

What's New

Date Description
2022-08-10 Allow http headers to be set in the request
2018-06-02 Add ability to send arbitrary text
2018-05-29 First published

Buy me a coffee!

About

A Chrome Extension, send link, image or selected text to webhooks by filters

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published