Bug 16022 - [GTK] loading scripts via src= with relative URL doesn't work
Summary: [GTK] loading scripts via src= with relative URL doesn't work
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Linux
: P2 Major
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2007-11-16 16:19 PST by doug turner
Modified: 2009-03-17 17:42 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description doug turner 2007-11-16 16:19:29 PST
I am seeing some odd behavior around loading a js via the script tag.  Using http, it appears that the js file referenced by the src attribute is not loaded.  For example,

In a js file:

x = [ 1, 2, 3, ];

in a html page:

<html>
<script src="b.js"></script>
<script>
alert (x.length);
</script>

When running this using the GtkLauncher, I see a reference error regarding the variable "x".  I also tried putting an alert in the javascript file to see if that would bring up a window, and that also failed.

When loading this over a local file, it seams to work fine.  I have tested this in Firefox and in the current nightly MacOS build of Webkit (r27834) and do not find the same problem.

I am using r27856.
Comment 1 doug turner 2007-11-16 16:40:13 PST
adding a http:// in front of the url seams to make this problem ago away.  

There is no url autocomplete.
Comment 2 David Kilzer (:ddkilzer) 2007-11-16 21:27:18 PST
But this *SHOULD* work.  Reopening and marking as GTK issue.
Comment 3 Tommi Komulainen 2008-03-09 17:59:17 PDT
Tested this briefly with r30908 and seems the problem is that the following do not work:

./GtkLauncher b.html
./GtkLauncher localhost:8000/b.html

but when called as below, the alert is shown as expected:

./GtkLauncher file://$PWD/b.html
./GtkLauncher http://localhost:8000/b.html
Comment 4 Gustavo Noronha (kov) 2009-03-17 17:42:40 PDT
WebKitGTK+ doesn't support broken URIs; you need to give it properly formed URIs so that it will work correctly. Browsers that want to provide the user with easy address typing should fix whatever broken URIs the user gives to it before feeding them to webkit =).

GtkLauncher currently lacks code to automatically add file:// and http:// to bad URIs given to it. I am not sure we want to add such code to the launcher, though.