Bug 28240

Summary: [Qt] Allow applications to register their own local URL scheme
Product: WebKit Reporter: Yael <yael>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Severity: Normal CC: behrooz.noorizadeh, hausmann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Description Flags
hausmann: review-
Patch hausmann: review+

Description Yael 2009-08-12 16:59:06 PDT
Expose registerURLSchemeAsLocal from Qt API.
Comment 1 Yael 2009-08-12 17:05:16 PDT
Created attachment 34709 [details]
Comment 2 Simon Hausmann 2009-08-13 08:12:19 PDT
Comment on attachment 34709 [details]

I agree with the need for this API, but I have a few suggestions and comments for the implementation:

> +/*!
> +    Allow applications to use a custome scheme instead of file: scheme,
> +    without being subjected to cross domain restrictions.
> +*/
> +void QWebSecurityOrigin::addLocalScheme(QString& scheme)

The QString argument should be a const QString &, not a QString &.

I think we may also need a function to remove a local scheme, i.e.

void removeLocalScheme(const QString &scheme);

as well as a function to return a list of all known local schemes:

QStringList QWebSecurityOrigin::localSchemes();
Comment 3 Simon Hausmann 2009-08-13 08:12:52 PDT
I forgot to add: We need an autotest for this feature. But it should be relatively easy to test I think.
Comment 4 Yael 2009-08-13 20:13:26 PDT
Created attachment 34804 [details]

Add the requested API, and an automated test
Comment 5 Yael 2009-08-14 05:50:32 PDT
Created attachment 34833 [details]

Added additional automated test at Ariya's request.
Comment 6 Simon Hausmann 2009-08-14 06:58:43 PDT
Comment on attachment 34833 [details]


It would be nice to have \since 4.6 tags in the documentation for the new functions.

If you have the time then it would also be nice to have a test that verifies that the local schemes actually work :)
Comment 7 Yael 2009-08-14 07:52:50 PDT
Landed in r47282