Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reject task append to JumpList when description exceeds 260 characters #28524

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/api/app.md
Expand Up @@ -924,6 +924,10 @@ re-add a removed item to a custom category earlier than that will result in the
entire custom category being omitted from the Jump List. The list of removed
items can be obtained using `app.getJumpListSettings()`.

**Note:** The maximum length of a Jump List item's `description` property is
260 characters. Beyond this limit, the item will not be added to the Jump
List, nor will it be displayed.

Here's a very simple example of creating a custom Jump List:

```javascript
Expand Down
4 changes: 4 additions & 0 deletions docs/api/structures/jump-list-category.md
Expand Up @@ -19,3 +19,7 @@
property set then its `type` is assumed to be `tasks`. If the `name` property
is set but the `type` property is omitted then the `type` is assumed to be
`custom`.

**Note:** The maximum length of a Jump List item's `description` property is
260 characters. Beyond this limit, the item will not be added to the Jump
List, nor will it be displayed.
2 changes: 1 addition & 1 deletion docs/api/structures/jump-list-item.md
Expand Up @@ -17,7 +17,7 @@
* `title` String (optional) - The text to be displayed for the item in the Jump List.
Should only be set if `type` is `task`.
* `description` String (optional) - Description of the task (displayed in a tooltip).
Should only be set if `type` is `task`.
Should only be set if `type` is `task`. Maximum length 260 characters.
* `iconPath` String (optional) - The absolute path to an icon to be displayed in a
Jump List, which can be an arbitrary resource file that contains an icon
(e.g. `.ico`, `.exe`, `.dll`). You can usually specify `process.execPath` to
Expand Down
7 changes: 7 additions & 0 deletions shell/browser/ui/win/jump_list.cc
Expand Up @@ -28,6 +28,13 @@ bool AppendTask(const JumpListItem& item, IObjectCollection* collection) {
FAILED(link->SetDescription(item.description.c_str())))
return false;

// SetDescription limits the size of the parameter to INFOTIPSIZE (1024),
// which suggests rejection when exceeding that limit, but experimentation
// has shown that descriptions longer than 260 characters cause a silent
// failure, despite SetDescription returning the success code S_OK.
if (item.description.size() > 260)
return false;

if (!item.icon_path.empty() &&
FAILED(link->SetIconLocation(item.icon_path.value().c_str(),
item.icon_index)))
Expand Down