Introduction
A .webloc file is a macOS
shortcut to a web page. Dragging an address from Safari’s address bar, or a link from a
page, to the desktop or a Finder window makes one, and opening it starts the default
browser at that address. It is the Mac’s counterpart of the Windows
.url Internet shortcut.
Very old files kept the address in the file’s resource fork, which is lost when the file is copied to other systems; current macOS writes it in the file’s ordinary contents.
Structure
A webloc file (see contents) is an
Apple property list holding a
dictionary with one key, URL, whose value is the address as a string. It
may be saved as XML or as a binary property list starting with bplist00.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>URL</key>
<string>https://fileformats.org/</string>
</dict>
</plist>
Not described
Known, not yet covered
- Reference: the classic Mac OS resource fork container (resource header, data and map) in which the old form stores its resources.
- Viewer: there is no viewer for .webloc files yet.
Unknown
- Reference: the contents of the resource-fork form’s
'drag','TEXT'and'url 'resources beyond their names: Apple has not published them and the sources read do not lay them out (contents).
Links
Software
- Finder – opens website locations in the default browser (macOS)
- Safari – Apple’s web browser, which makes them when an address is dragged out (macOS)
- plutil – built into macOS, prints and converts them like any property list (macOS)