Closed Bug 259979 Opened 20 years ago Closed 20 years ago

Changes to keyword.URL require restarting Firefox

Categories

(Core :: Networking, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla1.8beta1

People

(Reporter: jruderman, Assigned: darin.moz)

References

()

Details

(Keywords: helpwanted, Whiteboard: [good first bug])

Attachments

(2 files)

If you change keyword.URL but don't restart Firefox, keyword searches (triggered by typing non-URLs into the address bar) still use the old keyword.URL.
yeah, this should be easy to fix.
Keywords: helpwanted
Whiteboard: [good first bug]
Target Milestone: --- → Future
Should this be fixed by getting rid of init() and the member variable, or by observing changes to preferences and calling init() again?
since keyword URLs are not loaded that often, it might be better to just check the pref each time it is needed instead of implementing an observer scheme.
Attached patch hack v0Splinter Review
Check keyword.URL pref each time it is needed by removing Init() function and place code inside NewChannel(). Also removed redundant mKeywordURL member.
Attachment #165753 - Flags: review?(cbiesinger)
Comment on attachment 165753 [details] [diff] [review] hack v0 r=biesi, although I think it would be better to return NS_ERROR_NOT_AVAILABLE if the pref isn't available or empty. please ask darin@meer.net for superreview.
Attachment #165753 - Flags: review?(cbiesinger) → review+
Attachment #165753 - Flags: superreview?(darin)
Comment on attachment 165753 [details] [diff] [review] hack v0 >Index: netwerk/protocol/keyword/src/nsKeywordProtocolHandler.cpp >+ nsXPIDLCString url; >+ rv = prefs->GetCharPref("keyword.URL", getter_Copies(url)); >+ // if we can't find a keyword.URL keywords won't work. >+ if (NS_FAILED(rv) || !url || !*url) return NS_ERROR_FAILURE; I think there is no reason to make this check so complex. This is all you need: nsXPIDLCString url; prefs->GetCharPref("keyword.URL", getter_Copies(url)); // if we can't find a keyword.URL keywords won't work. if (url.IsEmpty()) return NS_ERROR_FAILURE; sr=darin with that change.
Attachment #165753 - Flags: superreview?(darin) → superreview+
Attached patch hack v1Splinter Review
change
Do I need to request r= and sr= again?
no need to re-request reviews after people gave + fixed-on-trunk
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Target Milestone: Future → mozilla1.8beta
This wasn't firefox specific, was it?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: