Skip to content

Commit db39bf8

Browse files
authored
Merge pull request #311 from OneNoteDev/bug/fix-third-party-cookie-message
Show browser-specific third-party cookie message
2 parents 0e26fc5 + c6cb149 commit db39bf8

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

Diff for: src/scripts/clipperUI/panels/signInPanel.tsx

+19-1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class SignInPanelClass extends ComponentBase<SignInPanelState, SignInPanelProps>
6666

6767
signInFailureThirdPartyCookiesBlocked(): boolean {
6868
return this.signInAttempted()
69+
&& !this.props.clipperState.userResult.data.user
6970
&& !this.props.clipperState.userResult.data.writeableCookies;
7071
}
7172

@@ -115,9 +116,26 @@ class SignInPanelClass extends ComponentBase<SignInPanelState, SignInPanelProps>
115116
if (this.signInFailureContainsErrorDescription()) {
116117
return this.props.clipperState.userResult.data.errorDescription;
117118
} else if (this.signInFailureThirdPartyCookiesBlocked()) {
119+
120+
let browserSpecificMessage = "";
121+
switch (this.props.clipperState.clientInfo.clipperType) {
122+
case ClientType.ChromeExtension:
123+
browserSpecificMessage = Localization.getLocalizedString("WebClipper.Error.CookiesDisabled.Chrome");
124+
break;
125+
case ClientType.EdgeExtension:
126+
browserSpecificMessage = Localization.getLocalizedString("WebClipper.Error.CookiesDisabled.Edge");
127+
break;
128+
case ClientType.FirefoxExtension:
129+
browserSpecificMessage = Localization.getLocalizedString("WebClipper.Error.CookiesDisabled.Firefox");
130+
break;
131+
default:
132+
browserSpecificMessage = Localization.getLocalizedString("WebClipper.Error.CookiesDisabled.Line2");
133+
break;
134+
}
135+
118136
return <div>
119137
<div class={Constants.Ids.signInErrorCookieInformation}>{Localization.getLocalizedString("WebClipper.Error.CookiesDisabled.Line1")}</div>
120-
<div class={Constants.Ids.signInErrorCookieInformation}>{Localization.getLocalizedString("WebClipper.Error.CookiesDisabled.Line2")}</div>
138+
<div class={Constants.Ids.signInErrorCookieInformation}>{browserSpecificMessage}</div>
121139
</div>;
122140
}
123141

Diff for: src/strings.json

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
"WebClipper.Error.CannotClipPage": "Sorry, this type of page can\u0027t be clipped.",
4747
"WebClipper.Error.CookiesDisabled.Line1": "Cookies must be enabled in order for OneNote Web Clipper to work correctly.",
4848
"WebClipper.Error.CookiesDisabled.Line2": "Please allow third-party cookies in your browser or add the onenote.com and live.com domains as an exception.",
49+
"WebClipper.Error.CookiesDisabled.Chrome": "Please allow third-party cookies in your browser or add the [*.]onenote.com and [*.]live.com domains as an exception.",
50+
"WebClipper.Error.CookiesDisabled.Edge": "Please allow third-party cookies in your browser.",
51+
"WebClipper.Error.CookiesDisabled.Firefox": "Please allow third-party cookies in your browser or add the https://onenote.com and https://live.com domains as an exception.",
4952
"WebClipper.Error.CorruptedSection": "Your clip can\u0027t be saved here because the section is corrupt.",
5053
"WebClipper.Error.GenericError": "Something went wrong. Please try clipping the page again.",
5154
"WebClipper.Error.GenericExpiredTokenRefreshError": "Your login session has ended and we were unable to clip the page. Please sign in again.",

0 commit comments

Comments
 (0)