Bug 28240 - [Qt] Allow applications to register their own local URL scheme
Summary: [Qt] Allow applications to register their own local URL scheme
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2009-08-12 16:59 PDT by Yael
Modified: 2009-08-14 07:52 PDT (History)
2 users (show)

See Also:

Patch (1.56 KB, patch)
2009-08-12 17:05 PDT, Yael
hausmann: review-
Details | Formatted Diff | Diff
Patch (6.75 KB, patch)
2009-08-13 20:13 PDT, Yael
no flags Details | Formatted Diff | Diff
Patch (6.85 KB, patch)
2009-08-14 05:50 PDT, Yael
hausmann: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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