Bug 99528 - [WebKit2] Create Objective-C API for adding and removing user scripts
Summary: [WebKit2] Create Objective-C API for adding and removing user scripts
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andy Estes
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-16 17:22 PDT by Andy Estes
Modified: 2012-10-16 19:00 PDT (History)
0 users

See Also:


Attachments
Patch (15.65 KB, patch)
2012-10-16 17:28 PDT, Andy Estes
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Estes 2012-10-16 17:22:33 PDT
[WebKit2] Create Objective-C API for adding and removing user scripts
Comment 1 Andy Estes 2012-10-16 17:28:11 PDT
Created attachment 169064 [details]
Patch
Comment 2 Anders Carlsson 2012-10-16 17:44:21 PDT
Comment on attachment 169064 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=169064&action=review

> Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.mm:125
> +- (void)addUserScript:(NSString *)source baseURL:(NSURL *)baseURL whitelist:(NSArray *)whitelist blacklist:(NSArray *)blacklist injectionTime:(WKUserScriptInjectionTime)injectionTime mainFrameOnly:(BOOL)mainFrameOnly

I think we should use more descriptive names for the whitelist and blacklist. How about whitelistedURLPatterns and blacklistedURLPatterns.

> Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.mm:128
> +    if (!source)
> +        return;

I think it's an error for source to be null, so we should not return early in that case. Ideally we'd throw an invalid argument exception but crashing is fine for now.
Comment 3 Andy Estes 2012-10-16 19:00:37 PDT
Committed r131544: <http://trac.webkit.org/changeset/131544>