cloudflare / embed-box

Universal install guide for embed codes and CMS plugins.
http://embedbox.io
MIT License
77 stars 12 forks source link

Ability to specify which services to allow embedding to? #130

Open ThisIsMissEm opened 4 years ago

ThisIsMissEm commented 4 years ago

Hi, I've read through the documentation, and for my product that I'd like to use EmbedBox with, we only support a subset of platforms that EmbedBox supports, so it doesn't make sense to show embed codes for them (for instance, for legal reasons)

Is it as simple as just doing:

EmbedBox.fetchedTargets = ['wordpress', 'drupal', 'generic' ]

After loading the embedbox script to specify which targets we support? This seems to not be clearly documented, or I'm missing it.

adamschwartz commented 4 years ago

Yup, that’s right.

The targets (or “services”) used come from concating the customTargets specified in the options with the fetchedTargets property on the class constructor.

https://github.com/cloudflare/embed-box/blob/f669c7edc93934632852cc0675a269f2bce4639f/app/embed-box-base.js#L78

I agree we should definitely document this. Thanks for bringing it to our attention!