epiphyt / embed-privacy

Embed Privacy prevents loading of embedded external content and allows your site visitors to opt-in.
https://epiph.yt/en/embed-privacy/
GNU General Public License v2.0
19 stars 12 forks source link

Add JS-API to enable/disable embeds #186

Open kraftner opened 1 year ago

kraftner commented 1 year ago

What feature are you requesting?

I love the fact that the plugin does one thing well in contrast to most other plugins offering embed consent that is bundled with consent banners and other functions. So you can mix and match features you need here.

The only thing that is missing for me right now is some kind of JS-API to enable/disable embeds without basically re-implementing most of the functionality in embed-privacy.js.

Something like:

window.embedPrivacy.enableProviderAlwaysActive()
window.embedPrivacy.disableProviderAlwaysActive()
window.embedPrivacy.enableAllProvidersAlwaysActive()
window.embedPrivacy.disableAllProvidersAlwaysActive()

Why is this feature necessary?

It would allow the plugin to be integrated with other 3rd party functionality, e.g. with a consent banner were you can give consent to load all embeds together with other things like tracking.

Are you expecing side-effects?

Apart from the general issue that you're opening a new API surface that needs to be maintained: No, since it doesn't change any of the existing functionality.

Code of Conduct

kraftner commented 1 year ago

This could maybe be considered in the context of #67.