NEW217869
Minor additions to minibrowser
https://bugs.webkit.org/show_bug.cgi?id=217869
Summary Minor additions to minibrowser
webkit
Reported 2020-10-16 22:08:37 PDT
Minor additions to minibrowser
Attachments
Patch (6.17 KB, patch)
2020-10-16 22:14 PDT, webkit
ews-feeder: commit-queue-
new patch (6.47 KB, patch)
2020-10-18 15:08 PDT, webkit
no flags
new patch (2) (6.44 KB, patch)
2020-10-18 16:06 PDT, webkit
ews-feeder: commit-queue-
webkit
Comment 1 2020-10-16 22:14:31 PDT
Alexey Proskuryakov
Comment 2 2020-10-17 09:48:26 PDT
*** Bug 217868 has been marked as a duplicate of this bug. ***
Darin Adler
Comment 3 2020-10-18 12:49:58 PDT
Comment on attachment 411655 [details] Patch Need to say why.
webkit
Comment 4 2020-10-18 13:01:32 PDT
When testing using the minibrowser certain https sites don't work, so this is an attempt to fix those issues so if and when someone does have issues with a https site while testing the engine they can try using this setting. I think someone made a point about something very similar in the dev thread on the slack channel a while back. thanks
Darin Adler
Comment 5 2020-10-18 13:24:04 PDT
Comment on attachment 411655 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=411655&action=review > Tools/MiniBrowser/mac/SettingsController.h:62 > +@property (nonatomic, readonly) BOOL useInvalidHTTPSWebsites; I would call this "allow", not "use". > Tools/MiniBrowser/mac/SettingsController.m:178 > + [self _addItemWithTitle:@"Enable accessing sites with an invalid HTTPS configuration" action:@selector(toggleUseInvalidHTTPSWebsites:) indented:YES]; This needs a shorter title. I think "Allow Invalid HTTPS" would be a good title. > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:795 > + SettingsController *settingsController = [[NSApplication sharedApplication] browserAppDelegate].settingsController; No need to mix styles here. Could just write NSApplication.sharedApplication.browserAppDelegate.settingsController. > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:797 > + if ([challenge protectionSpace].serverTrust > + && settingsController.useInvalidHTTPSWebsites) { WebKit coding style would put this on one line, not broken like this. > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:800 > + NSURLCredential *httpsCred = > + [[NSURLCredential alloc] initWithTrust:[challenge protectionSpace].serverTrust]; This is not WebKit project style formatting, breaking the line like this. I suggest doing it in one line. I think credential is a fine name for this local variable, fitting more with WebKit coding style. This object is being leaked here. This file does not get compiled with ARC, so we need to call release on httpsCred before returning.
webkit
Comment 6 2020-10-18 13:49:47 PDT
(In reply to Darin Adler from comment #5) > Comment on attachment 411655 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=411655&action=review > > > Tools/MiniBrowser/mac/SettingsController.h:62 > > +@property (nonatomic, readonly) BOOL useInvalidHTTPSWebsites; > > I would call this "allow", not "use". > > > Tools/MiniBrowser/mac/SettingsController.m:178 > > + [self _addItemWithTitle:@"Enable accessing sites with an invalid HTTPS configuration" action:@selector(toggleUseInvalidHTTPSWebsites:) indented:YES]; > > This needs a shorter title. I think "Allow Invalid HTTPS" would be a good > title. > Done. > > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:795 > > + SettingsController *settingsController = [[NSApplication sharedApplication] browserAppDelegate].settingsController; > > No need to mix styles here. Could just write > NSApplication.sharedApplication.browserAppDelegate.settingsController. > > > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:797 > > + if ([challenge protectionSpace].serverTrust > > + && settingsController.useInvalidHTTPSWebsites) { > > WebKit coding style would put this on one line, not broken like this. done. > > > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:800 > > + NSURLCredential *httpsCred = > > + [[NSURLCredential alloc] initWithTrust:[challenge protectionSpace].serverTrust]; > > This is not WebKit project style formatting, breaking the line like this. I > suggest doing it in one line. I think credential is a fine name for this > local variable, fitting more with WebKit coding style. > Will do. I did skim through the code style guide, but it is clear that I would need to go through it in depth before my next patch. > This object is being leaked here. This file does not get compiled with ARC, > so we need to call release on httpsCred before returning. My obj-c is rusty. Will fix. Sorry about that. Note: I didn't implement this for the Webkit1 viewer. Should I add this option to the webkit2-only settings menu, try to implement it for the Webkit1 viewer, or just leave as is? thanks.
webkit
Comment 7 2020-10-18 15:08:35 PDT
Created attachment 411719 [details] new patch Never mind on my latest comment, when I was coding it I forgot that I put it in Webkit2 only settings already. Sorry for the inconvenience. Submitted relevant patch
Darin Adler
Comment 8 2020-10-18 15:21:29 PDT
Comment on attachment 411719 [details] new patch View in context: https://bugs.webkit.org/attachment.cgi?id=411719&action=review > Tools/MiniBrowser/mac/SettingsController.m:717 > } > - > +- (void)toggleAllowInvalidHTTPSWebsites:(id)sender > +{ > + [self _toggleBooleanDefault:AllowInvalidHTTPSWebsitesKey]; > +} > +- (BOOL)allowInvalidHTTPSWebsites > +{ > + return [[NSUserDefaults standardUserDefaults] boolForKey:AllowInvalidHTTPSWebsitesKey]; > +} > - (BOOL)nonFastScrollableRegionOverlayVisible We’re leaving blank lines between the methods here, so I suggest the new code follow suit. > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:114 > + SettingsController *settingsController = NSApplication.sharedApplication.browserAppDelegate.settingsController; Funny that you made this change here, but not in your own new code ;) > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:796 > + if ([challenge protectionSpace].serverTrust && settingsController.allowInvalidHTTPSWebsites) { Could write challenge.protectionSpace.serverTrust. > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:797 > + // and if self signed enabled I don’t understand this comment. > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:798 > + NSURLCredential *credential = [[NSURLCredential alloc] initWithTrust:[challenge protectionSpace].serverTrust]; Could write challenge.protectionSpace.serverTrust.
webkit
Comment 9 2020-10-18 16:06:01 PDT
Created attachment 411721 [details] new patch (2) I implemented your suggestions and made another cold hard look at the patch. In addition, I made the Webkit2 comment comply with the Webkit Style Guide with using a full sentence, and removed the self signed comment as it was simply for marking the spot where I would put the code in while coding it.
Radar WebKit Bug Importer
Comment 10 2020-10-22 12:01:12 PDT
Note You need to log in before you can comment on or make changes to this bug.