Staying Logged In For A Bubble Chrome Extension

Hi,

So managed to make what I call a Bubble Chrome Extension by putting the Bubble App in an iframe within the the shell of a chrome extension. The only problem is that the extension doesn’t keep a user logged into the app. Each time you interact with it you have to login.

I assume there’s some esoteric web development or JavaScript-centric reason for this. Does anyone know what it is and if it can be bypassed?

In your workflows, when you login users in, there should be an option to keep them logged in. Is this selected yes and it still isn’t keeping them logged in?

Yes, it’s selected. Keeping users logged in works if I interact with the app “normally”. It just doesn’t work as part of a Chrome Extension.

I wonder if it’s a problem reading/accessing cookies, through an iFrame in the Chrome Extension.

Perhaps someone with more of a coding background can chime in?

You may need to declare the cookies as within scope using the Manifest JSON, if you haven’t already.

https://developer.chrome.com/extensions/cookies

I haven’t tried this before btw, but have been playing with Bubble and Chrome extensions for a little while.

1 Like

I added this to the manifest file but it didn’t work:

“permissions”: [
“activeTab”,
“cookies”,
://.google.com”,
//.bubbleapps.io*”
]

Take a look here.
Worth checking:

  1. that your domain exactly matches up with how Chrome is storing it… it looks from this post like you may just post bubbleapps.io*
  2. that you are injecting script onto your Bubble page that will fetch the Cookies - this won’t happen by default, so you have to manage it yourself. Chrome makes this pretty easy - you would do as the poster has done here, and create a JS file, add it the package and reference it’s name against the ‘Background’ key within the Manifest JSON. The script featured here looks pretty close to what you would need.

I gave this a go but haven’t managed to get it to work. Will keep on it, though. Thanks!

This post is quite dated but I ran into similar problems. Without the iFrame. I coded the extension. Did anybody find a solution for this?