mozilla-rally / rally

A monorepo for Rally project containing Rally SDK, Rally Web Platform and Extensions.
Mozilla Public License 2.0
7 stars 6 forks source link

Chrome store pop-up hidden by jumping to onboarding tab #311

Open rhelmer opened 2 years ago

rhelmer commented 2 years ago

@knowtheory pointed out a while back that the way we jump to or open a new onboarding tab hides this informative prompt that Chrome shows:

image

Firefox shows a similar prompt and does not have this problem. I've seen other popular extensions that have this issue on Chrome too, but I happened to come across one that didn't (the Chrome popup appears over their onboarding site) and took a look the differences between it and our approach:

The extension that does this correctly opens the tab in the runtime.onUpdated listener (only firing for "install" reason). We have quite a few async operations in between the extension opening for the first time and the onboarding page showing:

  1. wait for Firebase auth callback to fire
  2. check if extension is already signed in (if so, stop)
  3. check if rally members site is already open, if so jump to that tab
  4. open a new tab to rally members site

I think using runtime.onUpdated and checking for the "install" reason would let us skip steps 1/2, since if it's a new install the extension shouldn't be logged in already.

The challenges here are:

  1. this is very hard to test without actually pushing to the store, maybe with a dev build of Chrome it'd be possible but hard to say how much work that is
  2. if we start syncing extension storage then that would change the assumption that a newly-installed extension cannot shouldn't be logged in already

I suspect what we want to do is minimize the number of operations we perform between install and opening the tab, if we want to show this in time.

An alternative technique I've seen is that some extensions add a delay before onboarding, so the user has time to see the message. This seems OK, but less ideal than having it show on top of our onboarding site.