WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
183526
Allow NavigationState to intercept requests and send them to SystemPreviewController
https://bugs.webkit.org/show_bug.cgi?id=183526
Summary
Allow NavigationState to intercept requests and send them to SystemPreviewCon...
Dean Jackson
Reported
2018-03-09 14:32:59 PST
Allow NavigationState to intercept requests and send them to SystemPreviewController
Attachments
Patch
(9.94 KB, patch)
2018-03-09 14:40 PST
,
Dean Jackson
thorton
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Dean Jackson
Comment 1
2018-03-09 14:33:35 PST
<
rdar://problem/37801140
>
Dean Jackson
Comment 2
2018-03-09 14:40:58 PST
Created
attachment 335466
[details]
Patch
EWS Watchlist
Comment 3
2018-03-09 14:43:18 PST
Attachment 335466
[details]
did not pass style-queue: ERROR: Source/WebKit/UIProcess/SystemPreviewController.h:33: _WKPreviewControllerDataSource is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebKit/UIProcess/SystemPreviewController.h:34: _WKPreviewControllerDelegate is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 2 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Tim Horton
Comment 4
2018-03-09 15:24:03 PST
Comment on
attachment 335466
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=335466&action=review
> Source/WebKit/UIProcess/Cocoa/NavigationState.mm:658 > + if (page.systemPreviewController()->canPreview(navigationResponse->response().mimeType())) > + page.systemPreviewController()->showPreview(navigationResponse->response().url());
It seems a bit weird to take over if the client explicitly wants to download, and also weird to then go ahead with the download?
Dean Jackson
Comment 5
2018-03-09 15:28:20 PST
Comment on
attachment 335466
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=335466&action=review
>> Source/WebKit/UIProcess/Cocoa/NavigationState.mm:658 >> + page.systemPreviewController()->showPreview(navigationResponse->response().url()); > > It seems a bit weird to take over if the client explicitly wants to download, and also weird to then go ahead with the download?
I agree. But we can't nicely cancel the download at this point. Ultimately, we'll have a separate download client or logic that doesn't navigate.
Tim Horton
Comment 6
2018-03-09 15:30:07 PST
Comment on
attachment 335466
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=335466&action=review
>>> Source/WebKit/UIProcess/Cocoa/NavigationState.mm:658 >>> + page.systemPreviewController()->showPreview(navigationResponse->response().url()); >> >> It seems a bit weird to take over if the client explicitly wants to download, and also weird to then go ahead with the download? > > I agree. But we can't nicely cancel the download at this point. Ultimately, we'll have a separate download client or logic that doesn't navigate.
Or a separate policy type?
Dean Jackson
Comment 7
2018-03-09 15:32:36 PST
Comment on
attachment 335466
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=335466&action=review
>>>> Source/WebKit/UIProcess/Cocoa/NavigationState.mm:658 >>>> + page.systemPreviewController()->showPreview(navigationResponse->response().url()); >>> >>> It seems a bit weird to take over if the client explicitly wants to download, and also weird to then go ahead with the download? >> >> I agree. But we can't nicely cancel the download at this point. Ultimately, we'll have a separate download client or logic that doesn't navigate. > > Or a separate policy type?
Actually, it sort of works if I ignore the download! I originally considered a new policy type, but this one is actually set from Safari. I'll have to do something else for WKWebView clients.
Dean Jackson
Comment 8
2018-03-09 15:39:40 PST
Committed
r229488
: <
https://trac.webkit.org/changeset/229488
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug