+11
−6
Loading
Bug 1750390 - Don't show the Firefox Suggest online opt-in modal on top of about:welcome. r=nanj, a=RyanVM The logic we added to `_maybeShowDefaultBrowserPrompt()` in BrowserGlue in D135308 isn't enough to prevent the modal from opening on top of about:welcome. AFAICT the decision to open about:welcome isn't part of that logic at all. This revision bails out of `maybeShowOnboardingDialog()` if the top window's current tab is about:welcome. That seems sufficient to prevent this from happening in most cases. There are a couple of cases where this wouldn't work: 1. about:welcome is opened *after* the Suggest modal. But so far I've never seen that happen and I'm not sure it's even possible. Preventing this case would require deeper integration with the logic that opens about:welcome. It would also block the remainder of `_maybeShowDefaultBrowserPrompt()` that is awaiting the call to `maybeShowOnboardingDialog()`, which seems like a bad idea. 2. about:welcome is open in an unselected tab. This seems very unlikely because the user would need to select/open a new tab in the brief period of time between when about:welcome is shown and the modal is shown. It would be simple to look through all tabs in the top window (and all windows), but if the profile isn't new -- which would be the common case -- and it has restored a ton of tabs, it would be inefficient to look through all of them, and preventing this case is just not worth that. (tabbrowser doesn't have a set or map keyed on URLs that would provide O(1) lookup AFAIK.) Differential Revision: https://phabricator.services.mozilla.com/D136071