Cap-go / capacitor-inappbrowser

Capacitor plugin in app browser with urlChangeEvent
MIT License
71 stars 52 forks source link

feat: Send DNT and GPC headers for all requests #225

Open peacememories opened 2 weeks ago

peacememories commented 2 weeks ago

Current problem

We would like to send Do Not Track or Global Privacy Control headers with every request the in-app browser makes. We want to do this to comply with the choices users make through Apples App Tracking Transparency API.

Preferred solution

Allow injecting headers in the url-change or another appropriate event handler.

Alternative options

Add an option to the open call that enables DNT and GPC for all requests made by the browser session.

Additional context

No response

Before submitting

Fastest way to get this feature added

WcaleNieWolny commented 1 week ago

You could attempt to use this proxy feature.

You also might attempt to implement a custom service worker. I would not recommend using this proxy to proxy ALL of your requests, but that is up to you.

For you specific case, I would recommend using this proxy fn to serve a service worker, then register it via executeScript OR preLoadScript

WcaleNieWolny commented 1 week ago

I guess you would have to figure out how to use this proxy on iOS and not just Android.