Closed Bug 831609 Opened 11 years ago Closed 11 years ago

Defect - Don't open the home page when launching Metro Firefox for protocol activation, search activation, file activation, and secondary tiles.

Categories

(Firefox for Metro Graveyard :: General, defect, P1)

x86_64
Windows 8.1
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mbrubeck, Assigned: bbondy)

References

Details

(Keywords: perf, polish, Whiteboard: [Testing notes see Comment 7] feature=defect c=Opening_and_closing u=metro_firefox_user p=2 status=verified)

Attachments

(2 files, 3 obsolete files)

Steps to reproduce:
1. Make sure Firefox is the default browser
2. Make sure Metro Firefox is closed
3. Click a link in another app to open a web page

Expected results: Metro Firefox launches and starts opening the link immediately.

Actual results: Metro Firefox launches and loads the default start page, then starts opening the link in a second tab.

This makes startup seem more janky and distracting, hurting perceived performance.
Assignee: nobody → netzen
Our nsICommandLineHandler.handle implementation (in BrowserCLH.js) gets called twice when Firefox is launched from a link in another app -- first without a URL, then with the link URL.  Ideally we would get just one command line.
Whiteboard: [metro-mvp?][LOE:1] → [metro-mvp][LOE:1]
Keywords: perf, polish
Whiteboard: [metro-mvp][LOE:1]
Keywords: perf, polish
I agree. This is pretty ugly. How difficult is this to fix? I think this should probably become a v1 work item. For the person who is really living in Metro, this will quickly become very annoying.
Blocks: 831887
No longer blocks: metrov1triage
Whiteboard: feature=work
Hi Asa and Brian, let me know if this does need to be worked on so it can be scheduled?

Asa, if this is worked on, we should treat it as a Defect linked to:  Bug 831887 - Story - Activating Firefox from links in other apps
Flags: needinfo?(netzen)
Flags: needinfo?(asa)
Has not been worked on but needs to be worked on. I think treating it as a defect sounds good.
Flags: needinfo?(netzen)
Blocks: metrov1it4
Summary: Don't open the home page when launching Metro Firefox via a link from another app → Defect - Don't open the home page when launching Metro Firefox via a link from another app
Whiteboard: feature=work → feature=defect c=Opening_and_closing u=metro_firefox_user p=0
I agree with Brian.
Flags: needinfo?(asa)
Priority: -- → P1
Whiteboard: feature=defect c=Opening_and_closing u=metro_firefox_user p=0 → feature=defect c=Opening_and_closing u=metro_firefox_user p=2
I have this working I just need to do some patch cleanup / comment removals tonight then I'll post it.
Summary: Defect - Don't open the home page when launching Metro Firefox via a link from another app → Defect - Don't open the home page when launching Metro Firefox for protocol activation, search activation, file activation, and secondary tiles.
Attached patch Patch v1 - Front end code (obsolete) — Splinter Review
This cleans things up a lot.

Clean shutdown:
- Opening a secondary tile (pinned site to win8 start): Opens start UI
- Clicking on a link in Metro: Brings up that page as current page, no start UI
- Activating a secondary tile: That tile as current page, no start UI
- Search: Opens that search as current page, no start UI
- File activation: Opens that file as current page, no start UI

Unclean shutdown or if open-tabs-from-last-time option is on (Note closing from the application bar on the left via right click currently gives an unclean shutdown, that's not part of this bug):
- Opening a secondary tile: Opens previous tabs, no start UI
- Clicking on a link in Metro: Brings up that page as current page, and previous tabs as other tabs
- Activating a secondary tile: That tile as current page, and previous tabs as other tabs
- Search: Opens that search as current page, and previous tabs as other tabs
- File activation: Opens that file as current page, and previous tabs as other tabs

All of the metro platform integration cannot be easily tested by the way.  I think metro\base\test\browser_context_ui.js tests the startUI.
Attachment #724231 - Flags: review?(mbrubeck)
Whiteboard: feature=defect c=Opening_and_closing u=metro_firefox_user p=2 → [Testing notes see Comment 7] feature=defect c=Opening_and_closing u=metro_firefox_user p=2
Attachment #724231 - Attachment description: Patch v1 → Patch v1 - Front end code
Attached patch Patch v1 - Widget (obsolete) — Splinter Review
So the main idea behind the widget patch is to stash away the startup activation URI and then give access to it through metro utils.  We do this so the front end code can detect whether or not it should load StartUI early, or even not load it at all (see previous comment for a breakdown). 

The only somewhat complicated part of this patch is for secondary tiles. If we detect command line args for secondary tiles then we stash it away in the same way we do protocol activations.  If we have command line args that are not from secondary tiles then we need to stash away all command line args and process them after xpcom init.
Attachment #724233 - Flags: review?(jmathies)
Comment on attachment 724231 [details] [diff] [review]
Patch v1 - Front end code

Review of attachment 724231 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/metro/base/content/browser.js
@@ +139,5 @@
> +    function loadStartupURI() {
> +      let uri = activationURI || commandURL || Browser.getHomePage();
> +      if (uri === self.getHomePage()) {
> +        self.addTab(uri, true);
> +        StartUI.show(); // This makes about:start load a lot faster

Instead of (uri === self.getHomePage()), you should test (StartUI.isStartURI(uri)).
Attachment #724231 - Flags: review?(mbrubeck) → review+
Attached patch Patch v2 - Front end code (obsolete) — Splinter Review
Carrying forward r+. Updated 3 instances of getHomePage() to StartURI.isStartURI
Attachment #724231 - Attachment is obsolete: true
Attachment #724267 - Flags: review+
Status: NEW → ASSIGNED
Comment on attachment 724233 [details] [diff] [review]
Patch v1 - Widget

no comments after all, looks good.
Attachment #724233 - Flags: review?(jmathies) → review+
Updated commit message
Attachment #724267 - Attachment is obsolete: true
Attachment #725541 - Flags: review+
Updated commit message
Attachment #724233 - Attachment is obsolete: true
Attachment #725542 - Flags: review+
m-i closed, adding check-in needed.
Keywords: checkin-needed
Flags: needinfo?(jbecerra)
Depends on: 851897
Tested on 2013-03-20 using Nightly built from http://hg.mozilla.org/mozilla-central/rev/8156df33b757
Having set Firefox Nightly as the default browser, and performing the actions while it wasn't opened already:
- Tested going to the Bing app, clicking on one of the trending links at the bottom, then clicking on a search result tile. This opened Firefox Nightly for Metro with the link.
- Tested searching for something in the Bing app then clicking on one of the results, this opened Firefox Nightly for Metro with the search result page.
- Tested typing and entering http://www.bing.com/ in the Start page. This opened the Bing web site in Firefox Nightly for Metro.
- Tested by clicking on links in other apps like the Weather app which opened the links in Firefox Nightly for Metro.
- Tested creating secondary tiles and then clicking on them which opened Firefox Nightly for Metro with those pages.
- Tested opening a file by typing and entering the name of the file in the Start page (some sample html file), and this opened Firefox Nightly for Metro with that page.
- Tried to set Firefox Nightly as the default .mp4 file handler, but I could not find a way for the Metro version to become the default handler.

Tested this when the option was set to open with previously open tabs as well as default session preference. In all cases I didn't see a Start UI when launching the application using one of these forms of activation.
Status: RESOLVED → VERIFIED
Flags: needinfo?(jbecerra)
Whiteboard: [Testing notes see Comment 7] feature=defect c=Opening_and_closing u=metro_firefox_user p=2 → [Testing notes see Comment 7] feature=defect c=Opening_and_closing u=metro_firefox_user p=2 status=verified
User Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:26.0) Gecko/20100101 Firefox/26.0
Build ID: 20130812030209
Built from http://hg.mozilla.org/mozilla-central/rev/87c1796bc46c

WFM
Tested on windows 8 using latest nightly for iteration-11. Followed steps provided in comment7 and 16 and got expected result.

- Tested going to the Bing app, clicking on one of the trending links at the bottom, then clicking on a search result tile. This opened Firefox Nightly for Metro with the link.
- Tested searching for something in the Bing app then clicking on one of the results, this opened Firefox Nightly for Metro with the search result page.
- Tested typing and entering http://www.bing.com/ in the Start page. This opened the Bing web site in Firefox Nightly for Metro.
- Tested by clicking on links in other apps like the Weather app which opened the links in Firefox Nightly for Metro.
- Tested creating secondary tiles and then clicking on them which opened Firefox Nightly for Metro with those pages.
- Tested opening a file by typing and entering the name of the file in the Start page (some sample html file), and this opened Firefox Nightly for Metro with that page.
User Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0
Build ID: 20130825030201
Built from http://hg.mozilla.org/mozilla-central/rev/01576441bdc6

WFM
Tested on windows 8 using latest nightly for iteration-12. Followed steps provided in comment7 and got expected result.
OS: Windows 8 Metro → Windows 8.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: