Settings, share targets and App mode
Pulsar draws your app’s settings from JSON, opens shared links inside it, and keeps its window, cookies and storage apart from everything else.
Settings
settings is the same SettingSpec extensions use for their settings page: toggles, choices, chips, sliders, text fields and buttons. Pulsar draws it in ⋮ › App settings, in its own style, light and dark. See Native UI for every item.
The App starter’s settings
{
"sections": [
{
"title": "Look",
"items": [
{
"type": "choice",
"id": "theme",
"title": "Theme",
"icon": "moon",
"value": "auto",
"options": [
{"value": "auto", "label": "Like the phone"},
{"value": "light", "label": "Light"},
{"value": "dark", "label": "Dark"}
]
},
{
"type": "chips",
"id": "text_size",
"value": "m",
"options": [
{"value": "s", "label": "S"},
{"value": "m", "label": "M"},
{"value": "l", "label": "L"}
]
}
]
},
{
"title": "Cooking",
"footnote": "These settings only change Example Kitchen inside Pulsar.",
"items": [
{
"type": "toggle",
"id": "cook_mode",
"title": "Keep the screen on",
"sub": "While a recipe is open",
"icon": "sun",
"value": true
},
{
"type": "toggle",
"id": "hide_popup",
"title": "Hide the newsletter pop-up",
"icon": "eye_off",
"value": true
}
]
}
]
}- The values in the spec are the defaults. Pulsar keeps each user’s choices for your app and checks them against the spec.
- Your CSS and JS follow them with
whenand__pulsarApp.settings()(CSS, JS and headers). - After an update, values the new spec no longer accepts are dropped and the default comes back. Keep ids stable.
- Pulsar adds its own rows under yours: Reset to app defaults and About this app (version, where it updates from).
- At most 12 sections and 40 items; ids are 1–40 letters, digits,
.,_or-, unique in the pack.
App mode
| Field | What people get |
|---|---|
| "display": "standalone" | Its own window with a slim top bar in theme_color, the app’s name and “Running in Pulsar · Open in browser”. |
| "display": "fullscreen" | Its own window with no bar at all. Good for games and full-screen tools. |
| "opens_as": "app" | Opens in App mode (the default). |
| "opens_as": "tab" | Opens as a browser tab that belongs to the app: same cookies, CSS and JS as the window. |
- People can change how it opens after they install it, and add it to the home screen.
- Apps and their home-screen shortcuts never go to sleep like background tabs.
- An update that changes the name or icon updates the home-screen shortcut too.
Storage
- Your site’s own storage — cookies,
localStorage, IndexedDB, its cache — lives in the app’s jar, apart from the browser’s. - Pulsar keeps the exact text of your pack and each user’s settings on the phone. An update replaces the pack in one step; a failed update leaves the old one.
- When the app is removed, Pulsar clears everything it kept for it, even if that happens before the browser has started.