diff --git a/e2e-tests/playwright/support/server/default_config.ts b/e2e-tests/playwright/support/server/default_config.ts index dd496eb9a26..f9a09ae4d7c 100644 --- a/e2e-tests/playwright/support/server/default_config.ts +++ b/e2e-tests/playwright/support/server/default_config.ts @@ -580,6 +580,7 @@ const defaultServerConfig: AdminConfig = { DisableAppBar: false, DisableRefetchingOnBrowserFocus: false, DelayChannelAutocomplete: false, + YoutubeReferrerPolicy: false, }, AnalyticsSettings: { MaxUsersForStatistics: 2500, diff --git a/server/config/client.go b/server/config/client.go index d3090a2f701..5151f6f4e0a 100644 --- a/server/config/client.go +++ b/server/config/client.go @@ -142,6 +142,7 @@ func GenerateClientConfig(c *model.Config, telemetryID string, license *model.Li props["PersistentNotificationMaxRecipients"] = strconv.FormatInt(int64(*c.ServiceSettings.PersistentNotificationMaxRecipients), 10) props["AllowSyncedDrafts"] = strconv.FormatBool(*c.ServiceSettings.AllowSyncedDrafts) props["DelayChannelAutocomplete"] = strconv.FormatBool(*c.ExperimentalSettings.DelayChannelAutocomplete) + props["YoutubeReferrerPolicy"] = strconv.FormatBool(*c.ExperimentalSettings.YoutubeReferrerPolicy) props["UniqueEmojiReactionLimitPerPost"] = strconv.FormatInt(int64(*c.ServiceSettings.UniqueEmojiReactionLimitPerPost), 10) props["WranglerPermittedWranglerRoles"] = strings.Join(c.WranglerSettings.PermittedWranglerRoles, ",") diff --git a/server/platform/services/telemetry/telemetry.go b/server/platform/services/telemetry/telemetry.go index 2986922ec9a..570a445e083 100644 --- a/server/platform/services/telemetry/telemetry.go +++ b/server/platform/services/telemetry/telemetry.go @@ -778,6 +778,7 @@ func (ts *TelemetryService) trackConfig() { "enable_app_bar": !*cfg.ExperimentalSettings.DisableAppBar, "disable_refetching_on_browser_focus": *cfg.ExperimentalSettings.DisableRefetchingOnBrowserFocus, "delay_channel_autocomplete": *cfg.ExperimentalSettings.DelayChannelAutocomplete, + "youtube_referrer_policy": *cfg.ExperimentalSettings.YoutubeReferrerPolicy, }) ts.SendTelemetry(TrackConfigAnalytics, map[string]any{ diff --git a/server/public/model/config.go b/server/public/model/config.go index 4b9e596401b..bdcac297820 100644 --- a/server/public/model/config.go +++ b/server/public/model/config.go @@ -1075,6 +1075,7 @@ type ExperimentalSettings struct { DelayChannelAutocomplete *bool `access:"experimental_features"` DisableWakeUpReconnectHandler *bool `access:"experimental_features"` UsersStatusAndProfileFetchingPollIntervalMilliseconds *int64 `access:"experimental_features"` + YoutubeReferrerPolicy *bool `access:"experimental_features"` } func (s *ExperimentalSettings) SetDefaults() { @@ -1121,6 +1122,10 @@ func (s *ExperimentalSettings) SetDefaults() { if s.UsersStatusAndProfileFetchingPollIntervalMilliseconds == nil { s.UsersStatusAndProfileFetchingPollIntervalMilliseconds = NewPointer(int64(ExperimentalSettingsDefaultUsersStatusAndProfileFetchingPollIntervalMilliseconds)) } + + if s.YoutubeReferrerPolicy == nil { + s.YoutubeReferrerPolicy = NewBool(false) + } } type AnalyticsSettings struct { diff --git a/webapp/channels/src/components/admin_console/admin_definition.tsx b/webapp/channels/src/components/admin_console/admin_definition.tsx index e868e4d625c..ac06f00f1b4 100644 --- a/webapp/channels/src/components/admin_console/admin_definition.tsx +++ b/webapp/channels/src/components/admin_console/admin_definition.tsx @@ -6256,6 +6256,13 @@ const AdminDefinition: AdminDefinitionType = { help_text: defineMessage({id: 'admin.experimental.delayChannelAutocomplete.desc', defaultMessage: 'When true, the autocomplete for channel links (such as ~town-square) will only trigger after typing a tilde followed by a couple letters. When false, the autocomplete will appear as soon as the user types a tilde.'}), isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.EXPERIMENTAL.FEATURES)), }, + { + type: 'bool', + key: 'ExperimentalSettings.YoutubeReferrerPolicy', + label: defineMessage({id: 'admin.experimental.youtubeReferrerPolicy.title', defaultMessage: 'YouTube Referrer Policy:'}), + help_text: defineMessage({id: 'admin.experimental.youtubeReferrerPolicy.desc', defaultMessage: 'When true, the referrer policy for embedded YouTube videos will be set to "strict-origin-when-cross-origin" which resolves issues where YouTube video previews display as unavailable, while balancing the need to protect user privacy with some degree of referral data to support web functionalities, like analytics, logging, and third-party integrations. When false, the referrer policy will be set to "no-referrer" which enhances user privacy by not disclosing the source URL, but limits the ability to track user engagement and traffic sources in analytics tools.'}), + isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.EXPERIMENTAL.FEATURES)), + }, ], }, }, diff --git a/webapp/channels/src/components/youtube_video/__snapshots__/youtube_video.test.tsx.snap b/webapp/channels/src/components/youtube_video/__snapshots__/youtube_video.test.tsx.snap index 3fe7ab57fac..4e5f4901480 100644 --- a/webapp/channels/src/components/youtube_video/__snapshots__/youtube_video.test.tsx.snap +++ b/webapp/channels/src/components/youtube_video/__snapshots__/youtube_video.test.tsx.snap @@ -30,6 +30,7 @@ exports[`YoutubeVideo should match init snapshot 1`] = ` } postId="post_id_1" show={true} + youtubeReferrerPolicy={false} >