Closed Bug 356571 Opened 18 years ago Closed 16 years ago

loadOneOrMoreURIs gives up if one of the URLs has an unknown protocol

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 3.6a1

People

(Reporter: Gavin, Assigned: mak)

References

Details

(Keywords: fixed1.9.1)

Attachments

(1 file, 1 obsolete file)

The fix for bug 245588 made sure that we kept trying if one URL in the list was invalid. This was changed in bug 308396, because the individual tab loading was moved to loadTabs, which gives up once it finds an invalid URL (one for which loadURI throws). Luckily, the call to loadTabs was kept in the try/catch, so the "break startup" part of bug 245588 hasn't regressed.
I'll take this so I don't forget it, but please feel free to take this from me if you're interested in fixing it :)
Assignee: nobody → gavin.sharp
moving patch here from Bug 390592

this adds try catch into loadTabs, to it continues if an exception is thrown

Gavin, can this be useful?
I see a similar problem happen with bookmarks.
 
If the first bookmark points to a non-existing page on your disk and you right-click on this folder and choose "Open All in Tabs" it will show the Confirm Open dialog "You are about to open 26 tabs.." etc.
 
But when you confirm, it will only load one page, the "File not found" page.
Flags: blocking-firefox3?
Comment on attachment 275320 [details] [diff] [review]
Add try catch clauses in loadTabs

You shouldn't need the try/catch around the addTab calls given the landed patch for bug 366705.
Attachment #275320 - Flags: review-
Marco, do you want to take this?
i'm not sure on what still has to be done here. i'll do some testing and see if i can do something useful. will take from you if i have some good result (and time) in the next days
This will not block the final release of Firefox 3. Any patch will need unit tests in order to be approved.
Flags: blocking-firefox3? → blocking-firefox3-
I think we just need attachment 275320 [details] [diff] [review], but without the try/catch around addTab, and a browser-chrome test that will call loadOneOrMoreURIs directly.
Assignee: gavin.sharp → nobody
Whiteboard: [good first bug]
Attached patch patch v1.1Splinter Review
Gavin, sorry for being damn late.
Assignee: nobody → mak77
Attachment #275320 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #358014 - Flags: review?(gavin.sharp)
Comment on attachment 358014 [details] [diff] [review]
patch v1.1

>diff --git a/browser/base/content/test/browser_bug356571.js b/browser/base/content/test/browser_bug356571.js

>+// Save original prompt service factory

>+let fakePromptServiceFactory = {

>+  // Unregister the factory so we do not leak

>+  // Restore the original factory
>+  Cm.QueryInterface(Ci.nsIComponentRegistrar)
>+    .registerFactory(Components.ID(kPromptServiceUUID), "Prompt Service",
>+                     kPromptServiceContractID, kPromptServiceFactory);

Clever! I'm a bit worried that this might cause some test failures (e.g. due to not implementing all of promptservice, or whatever), though... will have to keep an eye on it I guess.

>diff --git a/browser/base/content/test/bug386835.html b/browser/base/content/test/bug386835.html
>deleted file mode 100644

>diff --git a/browser/base/content/test/dummy_page.html b/browser/base/content/test/dummy_page.html
>new file mode 100644

Could have just used |hg mv| for a smaller diff here, fwiw.
Attachment #358014 - Flags: review?(gavin.sharp) → review+
(In reply to comment #13)
> Clever! I'm a bit worried that this might cause some test failures (e.g. due to
> not implementing all of promptservice, or whatever), though... will have to
> keep an eye on it I guess.

indeed in a previous version i was using removeAllTabsBut, it was firing the "close tabs" dialog through nsPromptService and failing, that's the reason i looked how to restore the original factory, indeed after the restore it was working again correctly... Ideally unless we use any method that will use that service in this test while it's overridden should not cause issues.

> Could have just used |hg mv| for a smaller diff here, fwiw.
well yeah, still i've also changed the contents so the gain would have been really minimal.
http://hg.mozilla.org/mozilla-central/rev/e369a4bf546c
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [good first bug]
Target Milestone: --- → Firefox 3.2a1
Attachment #358014 - Flags: approval1.9.1?
Comment on attachment 358014 [details] [diff] [review]
patch v1.1

asking approval, low risk, comes with a test
Flags: in-testsuite+
Comment on attachment 358014 [details] [diff] [review]
patch v1.1

a191=beltzner
Attachment #358014 - Flags: approval1.9.1? → approval1.9.1+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: