Builder
How To Make Your Own Web Browser on Mac OS X, In Ten Easy Steps.
fraserspeirs came up with the instructions and helped me through 'em the first time. I'm just elaborating on what he wrote.
1. Sign up for a free Apple Developer Connection account at 'http://connect.apple.com/'. Go to the Download Software area, and download/install the December 2002 Mac OS X Developer Tools (under 'Developer Tools'), and the Web Kit SDK (v1.0) (under 'WWDC 2003').
2. Start up Project Builder (in '/Developer/Applications'), and create a new Cocoa Application project. Name it anything you like.
3. Open a Finder window and navigate to '/System/Library/Frameworks'. Drag the WebKit.framework folder into your Project Builder window, under 'Groups & Files'. It doesn't matter where you put it.
4. Click the arrow by Resources, and double-click on MainMenu.nib to open it in Interface Builder.
5. In your Finder window, go into 'WebKit.framework/Versions/Current/Heade rs'. Select all the files, and drag them into the MainMenu.nib window in Interface Builder. It should switch to the Classes tab and add a few classes to it, including one named WebView. You'll also get an error dialog complaining about an unknown superclass; click OK and ignore it.
6. In Interface Builder, click the Instances tab, then double-click on Window and you'll get an empty window and a 'Cocoa-Views' palette with lots of objects in it. Click the 'Containers' icon at the top of the palette (the sixth one over, has two tabs at the top of it). Drag 'CustomView' into your window. Click once on the CustomView in your window to select it, go to the Tools menu and select Show Info, and select Custom Class from the pulldown menu. Scroll the list down and click on WebView. This will be where the contents of web pages will appear.
7. Click on the second icon at the top of the Cocoa-Views palette, and drag the button named 'Button' into your window; double-click on it and name it 'Forward'. Then drag another one in; double-click on it and name it 'Back'. Drag the empty white rectangle (text field) into your window. This'll be where you type a URL in the finished application.
8. Hold down the Control key (that's Control, not Option or Command), and drag a line from the Back button to the WebView. An 'NSButton Info' window should appear. In it, click 'goBack:', then 'Connect'. Do the same to connect the Forward button to 'goForward:', and the text field to 'takeStringURLFrom:'. Don't forget to click 'Connect' each time.
9. Arrange and resize the items in your window however you want 'em. This probably will include making the text field wider, and making the WebView take up most of your window. When you have them where you want them, select 'Size' from the pulldown menu at the top of the info window. This is where you specify how things move when you resize the window. Click once on the WebView, and click on the lines inside its rectangle to change them to springs; this means its size will change, but the distance from its borders to the edges of the windows won't change. On the Back and Forward buttons and the text field, you'll want to change the line under their rectangles to be springs (since the distance from them to the bottom of the window can vary, but you want the distance to the top of the window to be the same). You should also put horizontal springs inside the text field so it can grow with the width of the window.
10. Select File/Save to save your interface modifications, then in the Project Builder window click the third icon from the left -- it's a hammer behind a couple of windows. This will build the project, then run it automatically for you. When the application window appears (looking just like the one you created), type 'http://www.apple.com/' in the text field, and hit Return. The Apple home page will appear. Try navigating around and using your Back and Forward buttons.
And that's all there is to it.
Notice that you never had to write any code.
Troubleshooting:
- If your buttons or text field don't work, make sure you connected them properly in step 8.
- If things move around weirdly when you resize your window, try adjusting the springs in step 9.
1. Sign up for a free Apple Developer Connection account at 'http://connect.apple.com/'. Go to the Download Software area, and download/install the December 2002 Mac OS X Developer Tools (under 'Developer Tools'), and the Web Kit SDK (v1.0) (under 'WWDC 2003').
2. Start up Project Builder (in '/Developer/Applications'), and create a new Cocoa Application project. Name it anything you like.
3. Open a Finder window and navigate to '/System/Library/Frameworks'. Drag the WebKit.framework folder into your Project Builder window, under 'Groups & Files'. It doesn't matter where you put it.
4. Click the arrow by Resources, and double-click on MainMenu.nib to open it in Interface Builder.
5. In your Finder window, go into 'WebKit.framework/Versions/Current/Heade
6. In Interface Builder, click the Instances tab, then double-click on Window and you'll get an empty window and a 'Cocoa-Views' palette with lots of objects in it. Click the 'Containers' icon at the top of the palette (the sixth one over, has two tabs at the top of it). Drag 'CustomView' into your window. Click once on the CustomView in your window to select it, go to the Tools menu and select Show Info, and select Custom Class from the pulldown menu. Scroll the list down and click on WebView. This will be where the contents of web pages will appear.
7. Click on the second icon at the top of the Cocoa-Views palette, and drag the button named 'Button' into your window; double-click on it and name it 'Forward'. Then drag another one in; double-click on it and name it 'Back'. Drag the empty white rectangle (text field) into your window. This'll be where you type a URL in the finished application.
8. Hold down the Control key (that's Control, not Option or Command), and drag a line from the Back button to the WebView. An 'NSButton Info' window should appear. In it, click 'goBack:', then 'Connect'. Do the same to connect the Forward button to 'goForward:', and the text field to 'takeStringURLFrom:'. Don't forget to click 'Connect' each time.
9. Arrange and resize the items in your window however you want 'em. This probably will include making the text field wider, and making the WebView take up most of your window. When you have them where you want them, select 'Size' from the pulldown menu at the top of the info window. This is where you specify how things move when you resize the window. Click once on the WebView, and click on the lines inside its rectangle to change them to springs; this means its size will change, but the distance from its borders to the edges of the windows won't change. On the Back and Forward buttons and the text field, you'll want to change the line under their rectangles to be springs (since the distance from them to the bottom of the window can vary, but you want the distance to the top of the window to be the same). You should also put horizontal springs inside the text field so it can grow with the width of the window.
10. Select File/Save to save your interface modifications, then in the Project Builder window click the third icon from the left -- it's a hammer behind a couple of windows. This will build the project, then run it automatically for you. When the application window appears (looking just like the one you created), type 'http://www.apple.com/' in the text field, and hit Return. The Apple home page will appear. Try navigating around and using your Back and Forward buttons.
And that's all there is to it.
Notice that you never had to write any code.
Troubleshooting:
- If your buttons or text field don't work, make sure you connected them properly in step 8.
- If things move around weirdly when you resize your window, try adjusting the springs in step 9.
24 comments

Link
Link
Link
Link
Sure, you could download Safari. But by following these instructions, anybody with little to no programming experience can create their own browser... and feel the power of being a developer! :)
Link
Apple is cool.
Link
Link
Link
Link
I really wouldn't want to trade my PowerBook for a Toshiba :-)
Link
Link
Probably not. The point is that Apple as a company cannot afford that risk. The software is the major attraction to buy the hardware.
on the other people wouldn't want to replace their Macs even if they could use the software elsewhere
I don't follow you on this point...care to expand?
Link
Link
Link
Link
Link
Link
Link
Link
Link
Switch those companies over!
Link
Link
Hello, Macintouch readers! :-)
Link
Link