Disable Email Page Location for all about:URIs

RESOLVED FIXED in Camino1.5

Status

Camino Graveyard
Toolbars & Menus
--
minor
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: froodian (Ian Leue), Assigned: froodian (Ian Leue))

Tracking

({fixed1.8.1})

1.8 Branch
Camino1.5
PowerPC
Mac OS X
fixed1.8.1

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

11 years ago
Per bug 342594:
http://wiki.caminobrowser.org/Development:Planning:Toolbar_item_validation#Email_Page_Location
(Assignee)

Comment 1

11 years ago
Created attachment 232867 [details] [diff] [review]
Disables Email Page Location and Fill Form for all about:URIs

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)
(Assignee)

Updated

11 years ago
Status: NEW → ASSIGNED

Comment 2

11 years ago
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)
(Assignee)

Comment 4

11 years ago
Created attachment 233616 [details] [diff] [review]
r=smorgan patch
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?
(Assignee)

Comment 6

11 years ago
I thought that *was* what we're doing.  This just shares the implementation instead of duplicating the code.

Comment 7

11 years ago
I think he means using -[NSString hasPrefix:].  I thought I looked for such a function when originally reviewing bug 302601, but I guess not.
(Assignee)

Comment 8

11 years ago
Created attachment 234908 [details] [diff] [review]
uses hasPrefix:

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+
(Assignee)

Updated

11 years ago
Whiteboard: [needs checkin]

Comment 10

11 years ago
Checked in
Status: ASSIGNED → RESOLVED
Last Resolved: 11 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.