Allow emulation of user gestures from Web Inspector console
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Feb 2019 00:52:56 +0000 (00:52 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Feb 2019 00:52:56 +0000 (00:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194725
<rdar://problem/48126604>

Reviewed by Joseph Pecoraro and Devin Rousso.

Source/JavaScriptCore:

* inspector/agents/InspectorRuntimeAgent.cpp: Add a new optional parameter, emulateUserGesture,
to the evaluate function, and mark the function as override so that PageRuntimeAgent
can change the behaviour.
(Inspector::InspectorRuntimeAgent::evaluate):
* inspector/agents/InspectorRuntimeAgent.h:
* inspector/protocol/Runtime.json:

Source/WebCore:

Test: inspector/runtime/evaluate-userGestureEmulation.html

* inspector/agents/page/PageRuntimeAgent.cpp: Override the emulate method and create
a UserGestureIndicator based on the emulateUserGesture option.
(WebCore::PageRuntimeAgent::evaluate):
* inspector/agents/page/PageRuntimeAgent.h:

Source/WebInspectorUI:

Add some UI for emulating a User Gesture when evaluating in the console. This
allows the developer to do things that would otherwise require actual interaction
with the page, such as start playback of media on iOS.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Setting.js: Add a new setting for this option.
* UserInterface/Controllers/JavaScriptLogViewController.js:
(WI.JavaScriptLogViewController.prototype.consolePromptTextCommitted):
* UserInterface/Controllers/RuntimeManager.js: Call evaluate with this new option.
(WI.RuntimeManager.prototype.evaluateInInspectedWindow):
* UserInterface/Views/LogContentView.js: Add a new checkbox in the upper bar
that allows the user to toggle the setting.
(WI.LogContentView):
(WI.LogContentView.prototype.get navigationItems):
(WI.LogContentView.prototype._handleEmulateInUserGestureSettingChanged):

* UserInterface/Views/NetworkTableContentView.js: Two drive-by typo fixes :)
(WI.NetworkTableContentView): perserve -> preserve
(WI.NetworkTableContentView.prototype.get navigationItems): checkboxs -> checkboxes

LayoutTests:

* inspector/runtime/evaluate-userGestureEmulation-expected.txt: Added.
* inspector/runtime/evaluate-userGestureEmulation.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241633 268f45cc-cd09-0410-ab3c-d52691b4dbfc

17 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/runtime/evaluate-userGestureEmulation-expected.txt [new file with mode: 0644]
LayoutTests/inspector/runtime/evaluate-userGestureEmulation.html [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp
Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h
Source/JavaScriptCore/inspector/protocol/Runtime.json
Source/WebCore/ChangeLog
Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp
Source/WebCore/inspector/agents/page/PageRuntimeAgent.h
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Base/Setting.js
Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js
Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js
Source/WebInspectorUI/UserInterface/Views/LogContentView.js
Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js

index c35b44e..e8f5c36 100644 (file)
@@ -1,3 +1,14 @@
+2019-02-15  Dean Jackson  <dino@apple.com>
+
+        Allow emulation of user gestures from Web Inspector console
+        https://bugs.webkit.org/show_bug.cgi?id=194725
+        <rdar://problem/48126604>
+
+        Reviewed by Joseph Pecoraro and Devin Rousso.
+
+        * inspector/runtime/evaluate-userGestureEmulation-expected.txt: Added.
+        * inspector/runtime/evaluate-userGestureEmulation.html: Added.
+
 2019-02-15  Ryosuke Niwa  <rniwa@webkit.org>
 
         Crash in the hit testing code via HTMLPlugInElement::isReplacementObscured()
diff --git a/LayoutTests/inspector/runtime/evaluate-userGestureEmulation-expected.txt b/LayoutTests/inspector/runtime/evaluate-userGestureEmulation-expected.txt
new file mode 100644 (file)
index 0000000..70c29c2
--- /dev/null
@@ -0,0 +1,9 @@
+Tests for Runtime emulateUserGesture option.
+
+
+== Running test suite: Runtime.evaluateUserGestureEmulation
+-- Running test case: EvaluateWithoutEmulatingUserGesture
+Not in User Gesture
+-- Running test case: EvaluateWithEmulatingUserGesture
+In User Gesture
+
diff --git a/LayoutTests/inspector/runtime/evaluate-userGestureEmulation.html b/LayoutTests/inspector/runtime/evaluate-userGestureEmulation.html
new file mode 100644 (file)
index 0000000..bbe4f4e
--- /dev/null
@@ -0,0 +1,48 @@
+<!doctype html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script>
+function test()
+{
+    let suite = InspectorTest.createAsyncSuite("Runtime.evaluateUserGestureEmulation");
+
+    suite.addTestCase({
+        name: "EvaluateWithoutEmulatingUserGesture",
+        description: "Evalute with the emulateUserGesture option set to false.",
+        async test() {
+            RuntimeAgent.evaluate.invoke({expression: `document.getElementById("foo").click()`, objectGroup: "test", emulateUserGesture: false}, (error) => {
+                InspectorTest.assert(!error, "Should not be a protocol error.");
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: "EvaluateWithEmulatingUserGesture",
+        description: "Evalute with the emulateUserGesture option set to true.",
+        async test() {
+            RuntimeAgent.evaluate.invoke({expression: `document.getElementById("foo").click()`, objectGroup: "test", emulateUserGesture: true}, (error) => {
+                InspectorTest.assert(!error, "Should not be a protocol error.");
+            });
+        }
+    });
+
+    suite.runTestCasesAndFinish();
+}
+
+function handleClick(event) {
+    if (window.internals)
+        TestPage.addResult(window.internals.isProcessingUserGesture() ? "In User Gesture" : "Not in User Gesture");
+}
+
+window.addEventListener("load", function () {
+    document.getElementById("foo").addEventListener("click", handleClick);
+    runTest();
+}, false);
+</script>
+</head>
+<body>
+<a id="foo"></a>
+<p>Tests for Runtime emulateUserGesture option.</p>
+</body>
+</html>
index 7dfb610..48fc750 100644 (file)
@@ -1,3 +1,18 @@
+2019-02-15  Dean Jackson  <dino@apple.com>
+
+        Allow emulation of user gestures from Web Inspector console
+        https://bugs.webkit.org/show_bug.cgi?id=194725
+        <rdar://problem/48126604>
+
+        Reviewed by Joseph Pecoraro and Devin Rousso.
+
+        * inspector/agents/InspectorRuntimeAgent.cpp: Add a new optional parameter, emulateUserGesture,
+        to the evaluate function, and mark the function as override so that PageRuntimeAgent
+        can change the behaviour.
+        (Inspector::InspectorRuntimeAgent::evaluate):
+        * inspector/agents/InspectorRuntimeAgent.h:
+        * inspector/protocol/Runtime.json:
+
 2019-02-15  Yusuke Suzuki  <ysuzuki@apple.com>
 
         [JSC] Do not initialize Wasm related data if Wasm is not enabled
index d68bb41..89bc203 100644 (file)
@@ -111,7 +111,7 @@ void InspectorRuntimeAgent::parse(ErrorString&, const String& expression, Protoc
     }
 }
 
-void InspectorRuntimeAgent::evaluate(ErrorString& errorString, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex)
+void InspectorRuntimeAgent::evaluate(ErrorString& errorString, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, const bool* /* emulateUserGesture */, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex)
 {
     InjectedScript injectedScript = injectedScriptForEval(errorString, executionContextId);
     if (injectedScript.hasNoValue())
index b6e2ad0..ea63d0b 100644 (file)
@@ -58,7 +58,7 @@ public:
     void enable(ErrorString&) override { m_enabled = true; }
     void disable(ErrorString&) override { m_enabled = false; }
     void parse(ErrorString&, const String& expression, Protocol::Runtime::SyntaxErrorType* result, Optional<String>& message, RefPtr<Protocol::Runtime::ErrorRange>&) final;
-    void evaluate(ErrorString&, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex) final;
+    void evaluate(ErrorString&, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, const bool* emulateUserGesture, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex) override;
     void awaitPromise(const String& promiseObjectId, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, Ref<AwaitPromiseCallback>&&) final;
     void callFunctionOn(ErrorString&, const String& objectId, const String& expression, const JSON::Array* optionalArguments, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown) final;
     void releaseObject(ErrorString&, const ErrorString& objectId) final;
index 42f0745..6902b5e 100644 (file)
                 { "name": "contextId", "$ref": "Runtime.ExecutionContextId", "optional": true, "description": "Specifies in which isolated context to perform evaluation. Each content script lives in an isolated context and this parameter may be used to specify one of those contexts. If the parameter is omitted or 0 the evaluation will be performed in the context of the inspected page." },
                 { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },
                 { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." },
-                { "name": "saveResult", "type": "boolean", "optional": true, "description": "Whether the resulting value should be considered for saving in the $n history." }
+                { "name": "saveResult", "type": "boolean", "optional": true, "description": "Whether the resulting value should be considered for saving in the $n history." },
+                { "name": "emulateUserGesture", "type": "boolean", "optional": true, "description": "Whether the expression should be considered to be in a user gesture or not." }
             ],
             "returns": [
                 { "name": "result", "$ref": "RemoteObject", "description": "Evaluation result." },
index e1735f0..c0a2b47 100644 (file)
@@ -1,3 +1,18 @@
+2019-02-15  Dean Jackson  <dino@apple.com>
+
+        Allow emulation of user gestures from Web Inspector console
+        https://bugs.webkit.org/show_bug.cgi?id=194725
+        <rdar://problem/48126604>
+
+        Reviewed by Joseph Pecoraro and Devin Rousso.
+
+        Test: inspector/runtime/evaluate-userGestureEmulation.html
+
+        * inspector/agents/page/PageRuntimeAgent.cpp: Override the emulate method and create
+        a UserGestureIndicator based on the emulateUserGesture option.
+        (WebCore::PageRuntimeAgent::evaluate):
+        * inspector/agents/page/PageRuntimeAgent.h:
+
 2019-02-15  Chris Dumez  <cdumez@apple.com>
 
         Sample domainsVisited diagnostic logging
index 1773670..68b4996 100644 (file)
@@ -42,6 +42,7 @@
 #include "ScriptController.h"
 #include "ScriptState.h"
 #include "SecurityOrigin.h"
+#include "UserGestureIndicator.h"
 #include <JavaScriptCore/InjectedScript.h>
 #include <JavaScriptCore/InjectedScriptManager.h>
 
@@ -170,4 +171,11 @@ void PageRuntimeAgent::notifyContextCreated(const String& frameId, JSC::ExecStat
         .release());
 }
 
+void PageRuntimeAgent::evaluate(ErrorString& errorString, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, const bool* emulateUserGesture, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex)
+{
+    Optional<ProcessingUserGestureState> userGestureState = (emulateUserGesture && *emulateUserGesture) ? Optional<ProcessingUserGestureState>(ProcessingUserGesture) : WTF::nullopt;
+    UserGestureIndicator gestureIndicator(userGestureState);
+    InspectorRuntimeAgent::evaluate(errorString, expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, executionContextId, returnByValue, generatePreview, saveResult, emulateUserGesture, result, wasThrown, savedResultIndex);
+}
+
 } // namespace WebCore
index d80f927..72a4b6c 100644 (file)
@@ -58,6 +58,7 @@ public:
     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
     void enable(ErrorString&) override;
     void disable(ErrorString&) override;
+    void evaluate(ErrorString&, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, const bool* emulateUserGesture, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex) final;
 
     // InspectorInstrumentation
     void didCreateMainWorldContext(Frame&);
index e2c797b..23826ba 100644 (file)
@@ -1,3 +1,31 @@
+2019-02-15  Dean Jackson  <dino@apple.com>
+
+        Allow emulation of user gestures from Web Inspector console
+        https://bugs.webkit.org/show_bug.cgi?id=194725
+        <rdar://problem/48126604>
+
+        Reviewed by Joseph Pecoraro and Devin Rousso.
+
+        Add some UI for emulating a User Gesture when evaluating in the console. This
+        allows the developer to do things that would otherwise require actual interaction
+        with the page, such as start playback of media on iOS.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        * UserInterface/Base/Setting.js: Add a new setting for this option.
+        * UserInterface/Controllers/JavaScriptLogViewController.js:
+        (WI.JavaScriptLogViewController.prototype.consolePromptTextCommitted):
+        * UserInterface/Controllers/RuntimeManager.js: Call evaluate with this new option.
+        (WI.RuntimeManager.prototype.evaluateInInspectedWindow):
+        * UserInterface/Views/LogContentView.js: Add a new checkbox in the upper bar
+        that allows the user to toggle the setting.
+        (WI.LogContentView):
+        (WI.LogContentView.prototype.get navigationItems):
+        (WI.LogContentView.prototype._handleEmulateInUserGestureSettingChanged):
+
+        * UserInterface/Views/NetworkTableContentView.js: Two drive-by typo fixes :)
+        (WI.NetworkTableContentView): perserve -> preserve
+        (WI.NetworkTableContentView.prototype.get navigationItems): checkboxs -> checkboxes
+
 2019-02-15  Nikita Vasilyev  <nvasilyev@apple.com>
 
         Web Inspector: Styles: valid values in style attributes are reported as unsupported property values
index db390f6..651be14 100644 (file)
@@ -411,6 +411,7 @@ localizedStrings["Event Dispatched"] = "Event Dispatched";
 localizedStrings["Event Listeners"] = "Event Listeners";
 localizedStrings["Events"] = "Events";
 localizedStrings["Example: \u201C%s\u201D"] = "Example: \u201C%s\u201D";
+localizedStrings["Emulate User Gesture"] = "Emulate User Gesture";
 localizedStrings["Exception with thrown value: %s"] = "Exception with thrown value: %s";
 localizedStrings["Exited Full-Screen Mode"] = "Exited Full-Screen Mode";
 localizedStrings["Exited Low-Power Mode"] = "Exited Low-Power Mode";
@@ -808,6 +809,7 @@ localizedStrings["Reveal in Original Resource"] = "Reveal in Original Resource";
 localizedStrings["Reveal in Resources Tab"] = "Reveal in Resources Tab";
 localizedStrings["Role"] = "Role";
 localizedStrings["Run %d"] = "Run %d";
+localizedStrings["Run console commands as if inside a user gesture"] = "Run console commands as if inside a user gesture";
 localizedStrings["Running the \u201C%s\u201D audit"] = "Running the \u201C%s\u201D audit";
 localizedStrings["Samples"] = "Samples";
 localizedStrings["Save %d"] = "Save %d";
index 270cf26..c5ee292 100644 (file)
@@ -129,6 +129,7 @@ WI.settings = {
     canvasRecordingAutoCaptureFrameCount: new WI.Setting("canvas-recording-auto-capture-frame-count", 1),
     clearLogOnNavigate: new WI.Setting("clear-log-on-navigate", true),
     clearNetworkOnNavigate: new WI.Setting("clear-network-on-navigate", true),
+    emulateInUserGesture: new WI.Setting("emulate-in-user-gesture", false),
     enableControlFlowProfiler: new WI.Setting("enable-control-flow-profiler", false),
     enableLineWrapping: new WI.Setting("enable-line-wrapping", false),
     groupByDOMNode: new WI.Setting("group-by-dom-node", false),
index d293c14..b7ec1e6 100644 (file)
@@ -242,6 +242,7 @@ WI.JavaScriptLogViewController = class JavaScriptLogViewController extends WI.Ob
             returnByValue: false,
             generatePreview: true,
             saveResult: true,
+            emulateUserGesture: WI.settings.emulateInUserGesture.value,
             sourceURLAppender: appendWebInspectorConsoleEvaluationSourceURL,
         };
 
index a71beec..be5f3de 100644 (file)
@@ -81,13 +81,14 @@ WI.RuntimeManager = class RuntimeManager extends WI.Object
             return;
         }
 
-        let {objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, saveResult, sourceURLAppender} = options;
+        let {objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, saveResult, emulateUserGesture, sourceURLAppender} = options;
 
         includeCommandLineAPI = includeCommandLineAPI || false;
         doNotPauseOnExceptionsAndMuteConsole = doNotPauseOnExceptionsAndMuteConsole || false;
         returnByValue = returnByValue || false;
         generatePreview = generatePreview || false;
         saveResult = saveResult || false;
+        emulateUserGesture = emulateUserGesture || false;
         sourceURLAppender = sourceURLAppender || appendWebInspectorSourceURL;
 
         console.assert(objectGroup, "RuntimeManager.evaluateInInspectedWindow should always be called with an objectGroup");
@@ -137,7 +138,8 @@ WI.RuntimeManager = class RuntimeManager extends WI.Object
         }
 
         // COMPATIBILITY (iOS 8): "saveResult" did not exist.
-        target.RuntimeAgent.evaluate.invoke({expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, contextId: executionContextId, returnByValue, generatePreview, saveResult}, evalCallback.bind(this), target.RuntimeAgent);
+        // COMPATIBILITY (iOS 12.2): "emulateUserGesture" did not exist.
+        target.RuntimeAgent.evaluate.invoke({expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, contextId: executionContextId, returnByValue, generatePreview, saveResult, emulateUserGesture}, evalCallback.bind(this), target.RuntimeAgent);
     }
 
     saveResult(remoteObject, callback)
index 1caca5c..964bd00 100644 (file)
@@ -66,12 +66,21 @@ WI.LogContentView = class LogContentView extends WI.ContentView
         this._selectedSearchMatch = null;
         this._selectedSearchMatchIsValid = false;
 
-        this._preserveLogNavigationItem = new WI.CheckboxNavigationItem("perserve-log", WI.UIString("Preserve Log"), !WI.settings.clearLogOnNavigate.value);
+        this._preserveLogNavigationItem = new WI.CheckboxNavigationItem("preserve-log", WI.UIString("Preserve Log"), !WI.settings.clearLogOnNavigate.value);
         this._preserveLogNavigationItem.tooltip = WI.UIString("Do not clear the console on new page loads");
-        this._preserveLogNavigationItem.addEventListener(WI.CheckboxNavigationItem.Event.CheckedDidChange, () => { WI.settings.clearLogOnNavigate.value = !WI.settings.clearLogOnNavigate.value; });
-        WI.settings.clearLogOnNavigate.addEventListener(WI.Setting.Event.Changed, this._clearLogOnNavigateSettingChanged, this);
+        this._preserveLogNavigationItem.addEventListener(WI.CheckboxNavigationItem.Event.CheckedDidChange, () => {
+            WI.settings.clearLogOnNavigate.value = !WI.settings.clearLogOnNavigate.value;
+        });
+        WI.settings.clearLogOnNavigate.addEventListener(WI.Setting.Event.Changed, this._handleClearLogOnNavigateSettingChanged, this);
+
+        this._emulateInUserGestureNavigationItem = new WI.CheckboxNavigationItem("emulate-in-user-gesture", WI.UIString("Emulate User Gesture"), WI.settings.emulateInUserGesture.value);
+        this._emulateInUserGestureNavigationItem.tooltip = WI.UIString("Run console commands as if inside a user gesture");
+        this._emulateInUserGestureNavigationItem.addEventListener(WI.CheckboxNavigationItem.Event.CheckedDidChange, () => {
+            WI.settings.emulateInUserGesture.value = !WI.settings.emulateInUserGesture.value;
+        });
+        WI.settings.emulateInUserGesture.addEventListener(WI.Setting.Event.Changed, this._handleEmulateInUserGestureSettingChanged, this);
 
-        this._checkboxsNavigationItemGroup = new WI.GroupNavigationItem([this._preserveLogNavigationItem, new WI.DividerNavigationItem]);
+        this._checkboxesNavigationItemGroup = new WI.GroupNavigationItem([this._preserveLogNavigationItem, this._emulateInUserGestureNavigationItem, new WI.DividerNavigationItem]);
 
         let scopeBarItems = [
             new WI.ScopeBarItem(WI.LogContentView.Scopes.All, WI.UIString("All"), {exclusive: true}),
@@ -136,7 +145,7 @@ WI.LogContentView = class LogContentView extends WI.ContentView
         if (WI.isShowingSplitConsole())
             navigationItems.push(new WI.DividerNavigationItem, this._showConsoleTabNavigationItem);
         else if (WI.isShowingConsoleTab())
-            navigationItems.unshift(this._findBanner, this._checkboxsNavigationItemGroup);
+            navigationItems.unshift(this._findBanner, this._checkboxesNavigationItemGroup);
 
         return navigationItems;
     }
@@ -844,11 +853,16 @@ WI.LogContentView = class LogContentView extends WI.ContentView
         this.performSearch(this._currentSearchQuery);
     }
 
-    _clearLogOnNavigateSettingChanged()
+    _handleClearLogOnNavigateSettingChanged()
     {
         this._preserveLogNavigationItem.checked = !WI.settings.clearLogOnNavigate.value;
     }
 
+    _handleEmulateInUserGestureSettingChanged()
+    {
+        this._emulateInUserGestureNavigationItem.checked = WI.settings.emulateInUserGesture.value;
+    }
+
     _keyDown(event)
     {
         let isRTL = WI.resolvedLayoutDirection() === WI.LayoutDirection.RTL;
index 43815af..349e685 100644 (file)
@@ -103,7 +103,7 @@ WI.NetworkTableContentView = class NetworkTableContentView extends WI.ContentVie
 
         this._emptyFilterResultsMessageElement = null;
 
-        this._clearOnLoadNavigationItem = new WI.CheckboxNavigationItem("perserve-log", WI.UIString("Preserve Log"), !WI.settings.clearNetworkOnNavigate.value);
+        this._clearOnLoadNavigationItem = new WI.CheckboxNavigationItem("preserve-log", WI.UIString("Preserve Log"), !WI.settings.clearNetworkOnNavigate.value);
         this._clearOnLoadNavigationItem.tooltip = WI.UIString("Do not clear network items on new page loads");
         this._clearOnLoadNavigationItem.addEventListener(WI.CheckboxNavigationItem.Event.CheckedDidChange, () => { WI.settings.clearNetworkOnNavigate.value = !WI.settings.clearNetworkOnNavigate.value; });
         WI.settings.clearNetworkOnNavigate.addEventListener(WI.Setting.Event.Changed, this._clearNetworkOnNavigateSettingChanged, this);
@@ -113,8 +113,8 @@ WI.NetworkTableContentView = class NetworkTableContentView extends WI.ContentVie
         this._harExportNavigationItem.tooltip = WI.UIString("HAR Export (%s)").format(WI.saveKeyboardShortcut.displayName);
         this._harExportNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, () => { this._exportHAR(); });
 
-        this._checkboxsNavigationItemGroup = new WI.GroupNavigationItem([this._clearOnLoadNavigationItem, new WI.DividerNavigationItem]);
-        this._checkboxsNavigationItemGroup.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low;
+        this._checkboxesNavigationItemGroup = new WI.GroupNavigationItem([this._clearOnLoadNavigationItem, new WI.DividerNavigationItem]);
+        this._checkboxesNavigationItemGroup.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low;
 
         this._buttonsNavigationItemGroup = new WI.GroupNavigationItem([this._harExportNavigationItem, new WI.DividerNavigationItem]);
         this._buttonsNavigationItemGroup.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low;
@@ -207,7 +207,7 @@ WI.NetworkTableContentView = class NetworkTableContentView extends WI.ContentVie
 
     get navigationItems()
     {
-        let items = [this._checkboxsNavigationItemGroup, this._buttonsNavigationItemGroup];
+        let items = [this._checkboxesNavigationItemGroup, this._buttonsNavigationItemGroup];
         if (this._disableResourceCacheNavigationItem)
             items.push(this._disableResourceCacheNavigationItem);
         items.push(this._clearNetworkItemsNavigationItem);