Prevent opening external URLs in the Web Inspector's WebView.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Apr 2012 01:18:10 +0000 (01:18 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Apr 2012 01:18:10 +0000 (01:18 +0000)
commitff15ff610b1b632c543aad518ea976a11db40c5f
tree8248ef2da0f2b4d7227bf36db269c689a6140871
parentd2d4107c5e267de5e6d2ac4f68af556c1b3508f9
Prevent opening external URLs in the Web Inspector's WebView.

All URLs not handled by the Inspector's JavaScript are now opened in the inspected WebView.

https://webkit.org/b/82812
rdar://problem/9488558

Reviewed by Joseph Pecoraro.

Source/WebKit/mac:

* WebCoreSupport/WebInspectorClient.mm:
(-[WebInspectorWindowController init]): Factored the URL code out of here into inspectorPagePath.
(-[WebInspectorWindowController inspectorPagePath]): Added.
(-[WebInspectorWindowController webView:decidePolicyForNavigationAction:request:frame:decisionListener:]): Added.
Only allow non-main frame and the inspector page. All other URLs will be opened in the inspected page.

Source/WebKit2:

* UIProcess/WebInspectorProxy.cpp:
(WebKit::decidePolicyForNavigationAction): Added. Only allow non-main frame and the inspector page. All other URLs
will be opened in the inspected page.
(WebKit::WebInspectorProxy::createInspectorPage): Set the policy client and use decidePolicyForNavigationAction.
* UIProcess/WebInspectorProxy.h: Made inspectorPageURL and inspectorBaseURL public for decidePolicyForNavigationAction.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebInspectorProxy.cpp
Source/WebKit2/UIProcess/WebInspectorProxy.h