webkitview Component

Use the webkitview component to display interactive web content within a native Alfred window. It allows you to render HTML, CSS, and JavaScript without requiring a separate browser window like Safari.

{
  "type": "webkitview",
  "src": "https://www.alfredapp.com"
}
Tip

It's good practice to use the size shared constraint to set a desired size for this layout. This acts like a minimum size in a layout.

Properties

openlinksexternally
BOOL | REGEX
Default: false (i.e. all links open internally)

Clicking a link within the web view will open that link with the macOS default handler. Provide a regex for more control over which links are opened externally.

text
STRING

Text to parse as html into this WebKit view.

src
STRING [getter]

The content to load. This can be a URL or a file path.

Also see Shared Properties.

Functions

Perform actions directly on this webkitview using the functions Action.

back

Navigate to the previous url if it exists.

forward

Navigate to the next url if it exists.

reload

Reload the current page.

Event Triggers

This component dispatches the following event triggers:

Trigger Description
"changed" When the url changes, e.g. when it is set or when navigating a website

Examples

Load the Alfred website

This example also overrides the default desired size to 400x800px.

{
  "constraints": {
    "size": {
      "width": 400,
      "height": 800
    }
  },
  "type": "webkitview",
  "src": "https://www.alfredapp.com"
}