Nativefier/src/options
Chris Dzombak b4ddd6865c
Support defining a custom bookmarks menu (fix #1065) (PR #1155)
This PR adds an optional, customizable menu of predefined bookmarks. In addition to containing a list of bookmarks, this file customizes the name of the menu and (optionally) allows assigning keyboard shortcuts to bookmarks. It adds a new command-line flag, `--bookmarks-menu <string>`, which can be set as the path to a JSON file containing configuration for the bookmarks menu.

Example of such a JSON file:

```json
{
    "menuLabel": "Music",
    "bookmarks": [
        {
            "title": "lofi.cafe",
            "url": "https://lofi.cafe/",
            "type": "link",
            "shortcut": "Cmd+1"
        },
        {
            "title": "beats to relax/study to",
            "url": "https://www.youtube.com/watch?v=5qap5aO4i9A",
            "type": "link",
            "shortcut": "Cmd+2"
        },
        {
            "type": "separator"
        },
        {
            "title": "RÜFÜS DU SOL Live from Joshua Tree",
            "type": "link",
            "url": "https://www.youtube.com/watch?v=Zy4KtD98S2c"
        }
    ]
}
```

## Checks
- [x] `npm run ci` passes

## Notes

Compared to the fork linked in #1065, this PR:
- adds no dependencies
- doesn't currently support submenus (this should be easy enough to add, but I didn't need it)

## Screenshot

<img width="853" alt="screenshot" src="https://user-images.githubusercontent.com/102904/115882015-5493a800-a41a-11eb-85ef-a190f3dbfe76.png">
2021-04-23 21:46:34 -04:00
..
fields Fix inferIcon error surfacing in full since recent axios 2021-01-15 21:57:19 -05:00
asyncConfig.ts Revamp and move to TypeScript (#898) 2020-03-15 16:50:01 -04:00
model.ts Support defining a custom bookmarks menu (fix #1065) (PR #1155) 2021-04-23 21:46:34 -04:00
normalizeUrl.test.ts Revamp and move to TypeScript (#898) 2020-03-15 16:50:01 -04:00
normalizeUrl.ts Revamp and move to TypeScript (#898) 2020-03-15 16:50:01 -04:00
optionsMain.test.ts macOS: Prompt for accessibility permissions if needed by Global Shortcuts using Media Keys (Fix #1120) (PR #1121) 2021-02-28 10:24:14 -05:00
optionsMain.ts Support defining a custom bookmarks menu (fix #1065) (PR #1155) 2021-04-23 21:46:34 -04:00