HOW-TO: Remove VLC as Default Web Browser option

Discussion in 'Mac Apps and Mac App Store' started by iCeFuSiOn, Feb 15, 2008.

  1. macrumors 6502a

    Joined:
    Jul 18, 2007
    #1
    Hello all,

    If you're running Mac OS X and you have a copy of VLC installed for playing all of those Windows file-types, you may have noticed under Safari's preferences that the default web browser can be set to "VLC (0.8.6d)".

    You're probably wondering why this happens. I was curious so I decided to dig through the files in VLC.app and inside of info.plist I found some useful information.

    Info.plist contains information regarding the application, what it can do, and what types of files it can open. This also applies to links (such as url, http, etc) -- you can see this in the below code:

    Code:
    	<key>CFBundleURLTypes</key>
    	<array>
    		<dict>
    			<key>CFBundleURLIconFile</key>
    			<string>generic</string>
    			<key>CFBundleURLName</key>
    			<string>http url</string>
    			<key>CFBundleURLSchemes</key>
    			<array>
    				<string>http</string>
    			</array>
    		</dict>
    		<dict>
    			<key>CFBundleURLIconFile</key>
    			<string>generic</string>
    			<key>CFBundleURLName</key>
    			<string>Secure HTTP</string>
    			<key>CFBundleURLSchemes</key>
    			<array>
    				<string>https</string>
    			</array>
    		</dict>
    		<dict>
    			<key>CFBundleURLIconFile</key>
    			<string>generic</string>
    			<key>CFBundleURLName</key>
    			<string>ftp url</string>
    			<key>CFBundleURLSchemes</key>
    			<array>
    				<string>ftp</string>
    			</array>
    		</dict>
    		<dict>
    			<key>CFBundleURLIconFile</key>
    			<string>generic</string>
    			<key>CFBundleURLName</key>
    			<string>Multimedia Stream URL</string>
    			<key>CFBundleURLSchemes</key>
    			<array>
    				<string>mms</string>
    			</array>
    		</dict>
    		<dict>
    			<key>CFBundleURLIconFile</key>
    			<string>generic</string>
    			<key>CFBundleURLName</key>
    			<string>RTSP</string>
    			<key>CFBundleURLSchemes</key>
    			<array>
    				<string>rtsp</string>
    			</array>
    		</dict>
    		<dict>
    			<key>CFBundleURLIconFile</key>
    			<string>generic</string>
    			<key>CFBundleURLName</key>
    			<string>udp url</string>
    			<key>CFBundleURLSchemes</key>
    			<array>
    				<string>udp</string>
    			</array>
    		</dict>
    	</array>
    If you're fine with axing a little bit of functionality (I don't use VLC to launch http links anyways, and I can't really imagine why it would really be wanted) then you can remove the above section of code from Info.plist.

    A quick guide on doing so follows:

    1. Locate VLC (usually in /Applications)
    2. Right click on VLC and click on "Show Package Contents"
    3. Navigate to the Contents folder.
    4. Make a copy of Info.plist somewhere on your Desktop to be safe.
    5. Open Info.plist in your favorite text editor (mine's TextWrangler, you can use TextEdit if you'd like).
    6. Locate the code mentioned above and remove it from the file.
    7. Save Info.plist, make sure it's located inside of /VLC.app/Contents/.
    8. Open a new Terminal (/Applications/Utilities)
    9. Run this command: sudo update_prebinding -root / -force
    10. Close Safari if you have it open.
    11. Close the Terminal.
    12. Now go ahead and open Safari, and check the preferences. "VLC" should have been removed from the list.

    If you're wondering what "sudo update_prebinding -root / -force" does, here's a run-down:

    sudo: runs the command as a super user or "root".

    update_prebinding: Updates the cache which stores information on installed programs and helps them load slightly faster (this is required for the new Info.plist information to take effect. You could probably reboot if you're really worried about running this command but I haven't tried it).
    -root : Specifies the OS installation disk (/ is the boot volume).

    / : Boot volume

    -force : This option will regenerate the shared cache files even if they appear to be already up-to-date.

    If you've lost your default .plist, you'll find it in the .ZIP I've attached to this post. I've also included the modified .plist for the sake of keeping it simple.

    NOTE: Info.plist includes the version number as well. If you update VLC on a regular basis you may want to manually remove the information specified above instead of using one of the attached files. I cannot be held responsible if VLC somehow breaks.

    Tested with VLC 0.8.6d on Mac OS X 10.5.2. Enjoy! :)
     

    Attached Files:

  2. macrumors regular

    Joined:
    Jan 13, 2004
    #2
    Didn't work. The only difference in my setup is that I'm running WebKit 30153.
     
  3. thread starter macrumors 6502a

    Joined:
    Jul 18, 2007
    #3
    Hmm, strange. Does it show in the actual Safari application vs. Webkit? (I know they're the same thing, but just asking for the sake of figuring out what happened here).
     

Share This Page