tangled
alpha
login
or
join now
jcs.org
/
shadowebkit
0
fork
atom
an experiment in making a cocoa webkit browser manageable under X11
0
fork
atom
overview
issues
pulls
pipelines
if a typed url has no scheme, prepend http://
jcs.org
14 years ago
0c76f18a
8b01385d
+8
-3
1 changed file
expand all
collapse all
unified
split
WKWindow.m
+8
-3
WKWindow.m
···
53
53
/* return key pressed on urlField */
54
54
- (void)loadURLFromTextField
55
55
{
56
56
-
[browser takeStringURLFrom:urlField];
56
56
+
[self loadURL:[urlField stringValue]];
57
57
}
58
58
59
59
- (void)loadURL: (NSString *)url
60
60
{
61
61
-
[wframe loadRequest:
62
62
-
[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
61
61
+
NSURL *u = [NSURL URLWithString:url];
62
62
+
63
63
+
if ([[u scheme] length] == 0)
64
64
+
u = [NSURL URLWithString:[NSString stringWithFormat:@"http://%@",
65
65
+
url]];
66
66
+
67
67
+
[wframe loadRequest:[NSURLRequest requestWithURL:u]];
63
68
}
64
69
65
70
/* called while the page is loading, and then again when it finishes */