# App shortcuts after install

> App shortcuts launch installed-app menu actions. Learn URL and scope rules, support, fallbacks, diagnostics, and how they differ from file Open with.

App shortcuts let users open key tasks or pages from an installed web app's icon. Each entry in
the manifest's `shortcuts` member supplies a name and destination URL. It can also supply
presentation data. Browsers can present those entries in a context menu when the user right-clicks or
long-presses the icon.

The compatibility dataset records support from Chrome 84 on Android and lists Samsung Internet as a mirror.
On desktop, it records support from Chrome and Edge 96. It also records Safari 17.4 on macOS.
It records no support in Safari on iOS or Firefox (BCD `manifests.webapp.shortcuts`).

## How it works

The menu is attached to an installed app. Chrome's documentation describes right-clicking the
app icon in the Windows taskbar or macOS Dock. On Android, the documented action is touching and
holding the launcher icon. Microsoft Edge exposes manifest shortcuts as Windows Jumplist items. Safari 17.4 on
macOS Sonoma places custom shortcut commands in the File menu and the Dock context menu.

The browser decides how many declared entries to show and how to present them. web.dev documents
limits of 10 shortcuts for Chrome and Edge on Windows and 3 for Chrome on Android, while MDN
states that browsers or operating systems may truncate the array. Put the most important actions
first. After installation, a changed list reaches the platform only after the manifest update
algorithm runs; changing the JSON does not promise an immediate menu refresh.

Each shortcut object carries `name` and `url`. Optional fields include `short_name` and
`description`; an entry can also supply `icons`. The specification resolves `url` against the manifest URL. A manifest at
`/dashboard/manifest.json` with `"url": "../projects"` therefore targets `/projects`. The
resolved URL must remain within the manifest scope; the processing algorithm ignores an entry
whose URL is not within scope. Shortcut icons use the same image-resource members as the
manifest's main `icons` array.

Activating an entry navigates to its `url`. Keep those destinations reachable from the app's own
interface as the working route when a browser does not expose the menu. A query parameter on the
shortcut URL can label that launch for application routing or analytics; web.dev recommends
annotating shortcut URLs in the same way as `start_url`.

The Web App Manifest specification defines a shortcut as a context-menu link to a key task or page.
File association uses the `file_handlers` manifest member instead. Its `action` chooses an in-scope
page, and that page reads the opened files from `launchQueue`. Microsoft documents this path on
Windows with **Open with > PWA file handlers demo**. Use the launch surface to choose the manifest
data and page code:

| Launch surface | Manifest data | Input delivered to the page |
| --- | --- | --- |
| Installed-app shortcut menu | A `shortcuts` item with `name` and `url` | Navigation to the shortcut URL |
| Windows **Open with** for a supported file | A `file_handlers` item with `action` and `accept` | Navigation to `action`, with file handles available from `launchQueue` |

:::caution
Safari 17.4 on macOS Sonoma labels its two surfaces **File** and the Dock context menu
([WebKit Features in Safari 17.4](https://webkit.org/blog/15063/webkit-features-in-safari-17-4/),
WebKit). Microsoft Edge calls the Windows surface a **Jumplist**
([Define app shortcuts](https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps/how-to/shortcuts),
Microsoft Learn). Do not use a complete manifest array as proof that every entry appears: MDN
leaves presentation and truncation to the browser and operating system.
:::

## Examples

Declare two shortcuts in the manifest, track which one launches the app, and keep their URLs available inside the app for browsers without shortcut support.

### Preventing an out-of-scope shortcut failure

The manifest lives at `/app/manifest.webmanifest`, so the relative URLs resolve under `/app/`. Each entry carries a `?source=shortcut` query so the app can attribute the launch.

```json
{
  "name": "Calendar",
  "start_url": "/app/",
  "scope": "/app/",
  "display": "standalone",
  "shortcuts": [
    {
      "name": "New event",
      "short_name": "New",
      "description": "Create an event starting now",
      "url": "new-event?source=shortcut",
      "icons": [{ "src": "icons/new-event-96.png", "sizes": "96x96", "type": "image/png" }]
    },
    {
      "name": "Today",
      "url": "today?source=shortcut",
      "icons": [{ "src": "icons/today-96.png", "sizes": "96x96", "type": "image/png" }]
    }
  ]
}
```

Writing `"url": "/new-event"` instead resolves outside `/app/`. The specification's processing
algorithm then ignores the shortcut because the target is outside the manifest scope. Keep the
relative destination under `/app/`, or widen `scope` deliberately if the app owns the target.

### Telling which shortcut launched the app, with a fallback for browsers without shortcuts

The app reads `location.pathname` and the `source` query on startup. It always exposes the same
destinations in its own menu, so the task remains reachable when the installed-app menu is absent
or truncated.

```js
const url = new URL(location.href);
const fromShortcut = url.searchParams.get('source') === 'shortcut';

if (fromShortcut && url.pathname.endsWith('/new-event')) {
  openEventEditor({ startsAt: Date.now() });
  analytics.track('launch_shortcut', { shortcut: 'new-event' });
} else {
  renderQuickActions([
    { label: 'New event', href: '/app/new-event?source=menu' },
    { label: 'Today', href: '/app/today?source=menu' },
  ]);
}

const installed = matchMedia('(display-mode: standalone)').matches;
document.body.dataset.launchMode = installed ? 'standalone' : 'browser';
```

The application controls the `source` value in both routes. The shortcut branch records the
manifest entry; the fallback branch renders ordinary links without claiming that JavaScript can
detect whether the operating system displayed a shortcut menu.

### Diagnosing a menu that does not appear

Start with the [`shortcuts` compatibility dataset](/compatibility/manifest-shortcuts/). A manifest edit cannot add the menu on a browser and operating system combination that the dataset records as unsupported. On Microsoft Edge, open DevTools, select **Application**, select **Manifest**, and scroll to the shortcuts list. Microsoft documents that panel as the place to test whether shortcuts are configured correctly. If the expected entry is absent there, inspect the manifest response the page actually links instead of assuming that the edited local file was served.

```js
const link = document.querySelector('link[rel="manifest"]');
if (!link) throw new Error('No manifest link');

const response = await fetch(link.href);
if (!response.ok) throw new Error(`Manifest HTTP ${response.status}`);

const manifest = await response.json();
const documentURL = new URL(location.href);
const parseURL = (value, base) => {
  if (typeof value !== 'string' || value === '') return null;
  try {
    return new URL(value, base);
  } catch {
    return null;
  }
};
const isWithinScope = (target, scope) =>
  target.origin === scope.origin && target.pathname.startsWith(scope.pathname);

const startCandidate = parseURL(manifest.start_url, link.href);
const startURL = startCandidate?.origin === documentURL.origin ? startCandidate : documentURL;
const defaultScope = new URL('.', startURL);
const scopeCandidate = parseURL(manifest.scope, link.href);
if (scopeCandidate) {
  scopeCandidate.search = '';
  scopeCandidate.hash = '';
}
const scope = scopeCandidate && isWithinScope(startURL, scopeCandidate)
  ? scopeCandidate
  : defaultScope;

console.info('Processed start URL and scope', { startURL: startURL.href, scope: scope.href });
const shortcuts = Array.isArray(manifest.shortcuts) ? manifest.shortcuts : [];
const rows = shortcuts.map((item) => {
  const target = parseURL(item?.url, link.href);
  return {
    name: item?.name,
    target: target?.href ?? 'invalid URL',
    validName: typeof item?.name === 'string' && item.name.trim() !== '',
    withinScope: target ? isWithinScope(target, scope) : false,
  };
});
console.table(rows);
```

An absent or unusable `start_url` falls back to the document URL. An absent or unusable `scope` falls back to the processed start URL's parent path; the same fallback applies when that scope does not contain the start URL. Use the table to find a missing or empty `name`, an invalid URL, a URL resolved against the wrong manifest directory, or a target outside that processed scope. The specification's shortcut-processing algorithm returns failure for an out-of-scope URL and for a missing or empty `name`. Correct the served manifest, then revisit the Application panel after the browser processes the manifest update. Keep the ordinary in-app links from the previous example available during that update path; they provide the same destinations without depending on an operating-system menu.

## See also

- [Web Application Manifest: shortcuts member](https://www.w3.org/TR/appmanifest/#shortcuts-member) (w3.org)
- [Expose common app actions as shortcuts](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/How_to/Expose_common_actions_as_shortcuts) (developer.mozilla.org)
- [Get things done quickly with app shortcuts](https://web.dev/articles/app-shortcuts) (web.dev)
- [Handle files in a PWA](https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps/how-to/handle-files) (Microsoft Learn)
- [`shortcuts` manifest member](/reference/manifest/shortcuts/)
- [`file_handlers` manifest member](/reference/manifest/file-handlers/)
- [`shortcuts` browser support](/compatibility/manifest-shortcuts/)
- [beforeinstallprompt event](/reference/installation/install-prompt/)
- [`scope` manifest member](/reference/manifest/scope/)