Open Bug 309781 Opened 20 years ago Updated 3 years ago

location entry shows URL file location instead of loaded location

Categories

(Core :: Networking: File, defect, P5)

defect

Tracking

()

People

(Reporter: chpe, Unassigned)

Details

(Whiteboard: [necko-would-take])

(Not sure "Location Bar" is the right component.) Bug 69114 added support for .lnk files on windows, and bug 308305 implemented support for .desktop files on GNOME. Those are files that contain a link and, when loaded, 'redirect' to the contained link. However, when I do this, the location entry keeps showing the file:/// location of the .desktop file, instead of the really loaded URL. (To test this, you can create a .desktop file of this type by dragging a link from gecko to the Nautilus desktop.) This is linux/gtk2 trunk (2005-09-22), but bug 69114 comment 78 seems to indicate the same happens on window with a .lnk file.
-> docshell, as per biesi's asessment.
Component: Location Bar → Embedding: Docshell
Assignee: location-bar → adamlock
QA Contact: adamlock
Doesn't the location bar just show whatever URI onLocationChange gets? How do I go about actually testing this on Linux (eg how do I create one of these .desktop files), given that I don't use GNOME?
cat > foo.desktop << EOF [Desktop Entry] Version=1.0 Encoding=UTF-8 Name=Verknüpfung mit Bug 309781 - location entry shows URL file location instead of loaded location Type=Link URL=https://bugzilla.mozilla.org/show_bug.cgi?id=309781 Icon=gnome-fs-bookmark EOF
So the issue is that docshell uses the originalURI of the channel unless LOAD_REPLACE is set. In this case, LOAD_REPLACE is not set, so we use the originalURI, which is the file:// URI (which we set as originalURI after calling newChannel). Setting LOAD_REPLACE in nsFileProtocolHandler::NewChannel here won't work, because NS_NewChannel will just clobber the flags right after that. The only way I see of getting this working is to hand back a nsFileChannel from newChannel and then later Redirect() to the HTTP channel.... That would make sure all the flags are set right and play nice with the world.
Assignee: adamlock → nobody
Component: Embedding: Docshell → Networking: File
OS: Linux → All
QA Contact: adamlock → networking.file
Hardware: PC → All
I think that's the best idea and is probably how I should've implemented this originally.
Whiteboard: [necko-would-take]
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.