Cap-go / capacitor-inappbrowser

Capacitor plugin in app browser with urlChangeEvent
MIT License
58 stars 38 forks source link

Clearing Cookies #36

Closed slyguy5646 closed 10 months ago

slyguy5646 commented 1 year ago

Hi there,

I'm using the browser and would like the functionality to clear the browser's cookies/instantiate a new browser rather than opening the same on as before. I need this in particular for a mobile OAuth flow. Is this is already a feature that is undocumented by any chance?

riderx commented 1 year ago

Hey thanks for the feedback feature is not present but i believe that not hard to to do, let me check this week, or next week ( a bit busy week)

slyguy5646 commented 1 year ago

Thanks for the response. Let me know if I can be of help in contributing.

riderx commented 1 year ago

I added clearCookies i let you try it :)

slyguy5646 commented 1 year ago

Thanks! I'll try it out.

mariusbolik commented 11 months ago

I am getting this error in Xcode when calling the method clearCookies():

⚡️  To Native ->  InAppBrowser clearCookies 15929536
⚡️  Error: Plugin InAppBrowser does not respond to method call "clearCookies" using selector "clearCookies:".
⚡️  Ensure plugin method exists, uses @objc in its declaration, and arguments match selector without callbacks in CAP_PLUGIN_METHOD.
⚡️  Learn more: https://capacitorjs.com/docs/plugins/ios/#defining-methods
2023-08-01 13:36:01.534406+0200 App[15636:795812] [tcp] tcp_input [C11.1.1:3] flags=[R] seq=4252994982, ack=0, win=0 state=LAST_ACK rcv_nxt=4252994982, snd_una=1254453612

I am calling the method before opening the browser to start with a fresh browser instance.

Edit: It also seems so that the promise doesn't resolve

riderx commented 11 months ago

@mariusbolik how sorry you are right, i updated the method you should see it in 1.0.7

mariusbolik commented 11 months ago

@riderx Thank you for the fast reply! One more thing: On Android the method also clears the local storage of the whole app. Is that a wanted behaviour or would it be better to clear the data only in the in-app-browser instance and not in the whole app?

riderx commented 11 months ago

should be only the in-app-browser, i tried to send a fix tell me if that help