diff --git a/docs/api/app.md b/docs/api/app.md index a254fb3e2c7..67167fd18e9 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -1191,8 +1191,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_ _Windows_ - Path to the app's icon. On Linux, 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 2b9625e1dfb..d7721e75cb8 100644 --- a/shell/browser/browser_mac.mm +++ b/shell/browser/browser_mac.mm @@ -377,11 +377,18 @@ void Browser::ShowAboutPanel() { 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]; }