Closed Bug 347498 Opened 18 years ago Closed 18 years ago

Disable Email Page Location for all about:URIs

Categories

(Camino Graveyard :: Toolbars & Menus, defect)

1.8 Branch
PowerPC
macOS
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED
Camino1.5

People

(Reporter: froodian, Assigned: froodian)

Details

(Keywords: fixed1.8.1)

Attachments

(1 file, 2 obsolete files)

This steals the code I wrote to exclude about:URIs from the top ten list, and implements it as an extension to NSString.
Attachment #232867 - Flags: review?(stuart.morgan)
Status: NEW → ASSIGNED
Comment on attachment 232867 [details] [diff] [review]
Disables Email Page Location and Fill Form for all about:URIs

>+- (BOOL)isAboutURI
>+{
>+  NSRange firstColon = [self rangeOfString:@":"];
>+  // If there's a colon in the URI and everything up to it is "about", it is one
>+  if((firstColon.location != NSNotFound) && [[self substringToIndex:firstColon.location] isEqual:@"about"])
>+    return YES;
>+
>+  return NO;
>+}

Remove the comment (the code is self-explanatory), and just return the condition directly.

>+    NSString* curURL = [[self getBrowserWrapper] getCurrentURI];
>+    return ![curURL isAboutURI];

Do this as one line (i.e., don't store curURL)

r=me with (heck, even without) those changes
Attachment #232867 - Flags: review?(stuart.morgan) → review+
Comment on attachment 232867 [details] [diff] [review]
Disables Email Page Location and Fill Form for all about:URIs

Requesting sr so we don't forget about this patch.
Attachment #232867 - Flags: superreview?(mikepinkerton)
Attached patch r=smorgan patch (obsolete) — Splinter Review
Attachment #232867 - Attachment is obsolete: true
Attachment #233616 - Flags: superreview?(mikepinkerton)
Attachment #232867 - Flags: superreview?(mikepinkerton)
why can't you just check if the prefix of the url is "about:"? why do all the complicated gymnastics to do the same thing?
I thought that *was* what we're doing.  This just shares the implementation instead of duplicating the code.
I think he means using -[NSString hasPrefix:].  I thought I looked for such a function when originally reviewing bug 302601, but I guess not.
Attached patch uses hasPrefix:Splinter Review
Ah.  Good stuff. :)
Attachment #233616 - Attachment is obsolete: true
Attachment #234908 - Flags: superreview?(mikepinkerton)
Attachment #233616 - Flags: superreview?(mikepinkerton)
Comment on attachment 234908 [details] [diff] [review]
uses hasPrefix:

sr=pink
Attachment #234908 - Flags: superreview?(mikepinkerton) → superreview+
Whiteboard: [needs checkin]
Checked in
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Whiteboard: [needs checkin]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: