diff --git a/docs/api/app.md b/docs/api/app.md index d9215959bbb38..e51a9f9dbb45c 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -1186,8 +1186,9 @@ Show the app's about panel options. These options can be overridden with `app.se * `website` String (optional) _Linux_ - The app's website. * `iconPath` String (optional) _Linux_ - Path to the app's icon. Will be shown as 64x64 pixels while retaining aspect ratio. -Set the about panel options. This will override the values defined in the app's -`.plist` file on MacOS. See the [Apple docs][about-panel-options] for more details. On Linux, values must be set in order to be shown; there are no defaults. +Set the about panel options. This will override the values defined in the app's `.plist` file on MacOS. See the [Apple docs][about-panel-options] for more details. On Linux, values must be set in order to be shown; there are no defaults. + +If you do not set `credits` but still wish to surface them in your app, AppKit will look for a file named "Credits.html", "Credits.rtf", and "Credits.rtfd", in that order, in the bundle returned by the NSBundle class method main. The first file found is used, and if none is found, the info area is left blank. See Apple [documentation](https://developer.apple.com/documentation/appkit/nsaboutpaneloptioncredits?language=objc) for more information. ### `app.isEmojiPanelSupported()` diff --git a/shell/browser/browser_mac.mm b/shell/browser/browser_mac.mm index 8730d9a22beb7..60d61b107c2a8 100644 --- a/shell/browser/browser_mac.mm +++ b/shell/browser/browser_mac.mm @@ -360,11 +360,18 @@ void RemoveFromLoginItems() { NSDictionary* options = DictionaryValueToNSDictionary(about_panel_options_); // Credits must be a NSAttributedString instead of NSString - id credits = options[@"Credits"]; + NSString* credits = (NSString*)options[@"Credits"]; if (credits != nil) { - NSMutableDictionary* mutable_options = [options mutableCopy]; - mutable_options[@"Credits"] = [[[NSAttributedString alloc] - initWithString:(NSString*)credits] autorelease]; + base::scoped_nsobject mutable_options( + [options mutableCopy]); + base::scoped_nsobject creditString( + [[NSAttributedString alloc] + initWithString:credits + attributes:@{ + NSForegroundColorAttributeName : [NSColor textColor] + }]); + + [mutable_options setValue:creditString forKey:@"Credits"]; options = [NSDictionary dictionaryWithDictionary:mutable_options]; }