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"
}
TipIt's good practice to use the
sizeshared 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.
Also see Shared Properties.
Functions
Perform actions directly on this webkitview using the functions Action.
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"
}