Skip to content

Commit 0a2e014

Browse files
authored
Update DisableNavigatingBackAndForward.md
Fix line lengths
1 parent 598aa76 commit 0a2e014

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

specs/DisableNavigatingBackAndForward.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
# API spec for disable navigating back/forward
22

33
# Background
4-
This problem was first proposed by a developer on GitHub, who wants to prevent users navigating back or forward using any of the built-in shortcut keys or special mouse buttons.
4+
This problem was first proposed by a developer on GitHub, who wants to prevent users navigating
5+
back or forward using any of the built-in shortcut keys or special mouse buttons.
56

6-
Afterwards, Teams made similar demands. They wanted a mechanism which could support them in controlling the behaviors of `go back` and `go forward` freely, like disabling them.
7+
Afterwards, Teams made similar demands. They wanted a mechanism which could support them in
8+
controlling the behaviors of `go back` and `go forward` freely, like disabling them.
79

8-
@Haichao Zhu has already finished some work on letting application developers handle all input and decide whether to suppress.
10+
@Haichao Zhu has already finished some work on letting application developers handle all input and
11+
decide whether to suppress.
912

10-
This should be solvable in a generic way. However, this feature hasn’t been released yet, and it might be better if we could provide a simpler and more direct way.
13+
This should be solvable in a generic way. However, this feature hasn’t been released yet, and it might
14+
be better if we could provide a simpler and more direct way.
1115

12-
Therefore, our job is to provide a mechanism for developers to disable navigating back and forward without excessive effort.
16+
Therefore, our job is to provide a mechanism for developers to disable navigating back and forward
17+
without excessive effort.
1318

1419

1520
# Examples
@@ -29,7 +34,8 @@ CHECK_FAILURE(m_webView->add_NavigationStarting(
2934
wil::com_ptr<ICoreWebView2NavigationStartingEventArgs3> args3;
3035
if (SUCCEEDED(args->QueryInterface(IID_PPV_ARGS(&args3))))
3136
{
32-
COREWEBVIEW2_NAVIGATION_HISTORY_CHANGE_KIND history_change = COREWEBVIEW2_NAVIGATION_HISTORY_CHANGE_KIND_OTHER;
37+
COREWEBVIEW2_NAVIGATION_HISTORY_CHANGE_KIND history_change =
38+
COREWEBVIEW2_NAVIGATION_HISTORY_CHANGE_KIND_OTHER;
3339
CHECK_FAILURE(args3->get_NavigationHistoryChange(&history_change));
3440
if (history_change != COREWEBVIEW2_NAVIGATION_HISTORY_CHANGE_KIND_OTHER)
3541
{
@@ -67,20 +73,26 @@ void WebView_NavigationStarting(object sender, CoreWebView2NavigationStartingEve
6773
// Enums and structs
6874
[v1_enum]
6975
typedef enum COREWEBVIEW2_NAVIGATION_HISTORY_CHANGE_KIND {
70-
/// Indicates a navigation that is going back to a previous entry in the navigation history. For example, a navigation caused by `CoreWebView2.GoBack` or in script `window.history.go(-1)`.
76+
/// Indicates a navigation that is going back to a previous entry in the navigation history.
77+
/// For example, a navigation caused by `CoreWebView2.GoBack` or in script `window.history.go(-1)`.
7178
COREWEBVIEW2_NAVIGATION_HISTORY_CHANGE_KIND_BACK,
72-
/// Indicates a navigation that is going forward to a later entry in the navigation history. For example, a navigation caused by `CoreWebView2.GoForward` or in script `window.history.go(1)`.
79+
/// Indicates a navigation that is going forward to a later entry in the navigation history.
80+
/// For example, a navigation caused by `CoreWebView2.GoForward` or in script `window.history.go(1)`.
7381
COREWEBVIEW2_NAVIGATION_HISTORY_CHANGE_KIND_FORWARD,
74-
/// Indicates a navigation that is not going back or forward to an existing entry in the navigation history. For example, a navigation caused by `CoreWebView2.Navigate`, or `CoreWebView2.Reload` or in script `window.location.href = 'https://example.com/'`.
82+
/// Indicates a navigation that is not going back or forward to an existing entry in the navigation
83+
/// history. For example, a navigation caused by `CoreWebView2.Navigate`, or `CoreWebView2.Reload`
84+
/// or in script `window.location.href = 'https://example.com/'`.
7585
COREWEBVIEW2_NAVIGATION_HISTORY_CHANGE_KIND_OTHER,
7686
} COREWEBVIEW2_NAVIGATION_HISTORY_CHANGE_KIND;
7787

7888
/// Extend `NavigationStartingEventArgs` by adding more information.
7989
[uuid(39A27807-2365-470B-AF28-885502121049), object, pointer_default(unique)]
8090
interface ICoreWebView2NavigationStartingEventArgs3 : ICoreWebView2NavigationStartingEventArgs2 {
8191

82-
/// Indicates if this navigation is going back or forward to an existing entry in the navigation history.
83-
[propget] HRESULT NavigationHistoryChange([out, retval] COREWEBVIEW2_NAVIGATION_HISTORY_CHANGE_KIND* history_change);
92+
/// Indicates if this navigation is going back or forward to an existing entry in the navigation
93+
/// history.
94+
[propget] HRESULT NavigationHistoryChange(
95+
[out, retval] COREWEBVIEW2_NAVIGATION_HISTORY_CHANGE_KIND* history_change);
8496
}
8597
}
8698
```

0 commit comments

Comments
 (0)