Skip to content

Commit

Permalink
[MM-63325, MM-63329] feat: dont register plugins or show the footer i…
Browse files Browse the repository at this point in the history
…f MMEMBED cookie is set to `1` (mattermost#30393)

* feat: no-op register plugin if MMEMBED=1
* feat: disable footer links when MMEMBED=1
  • Loading branch information
fmartingr authored Mar 3, 2025
1 parent 854011c commit 255e1a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions webapp/channels/src/components/header_footer_route/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ const Footer = () => {

const {AboutLink, PrivacyPolicyLink, TermsOfServiceLink, HelpLink} = useSelector(getConfig);

// Check if MMEMBED cookie is set and if so, don't show the footer
if (document.cookie.includes('MMEMBED=1')) {
return null;
}

return (
<div className='hfroute-footer'>
<span
Expand Down
5 changes: 5 additions & 0 deletions webapp/channels/src/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ window.plugins = {};
// During the beta, plugins manipulated the global window.plugins data structure directly. This
// remains possible, but is officially deprecated and may be removed in a future release.
function registerPlugin(id: string, plugin: Plugin): void {
// Don't register plugins if MMEMBED cookie is set
if (document.cookie.includes('MMEMBED=1')) {
return;
}

const oldPlugin = window.plugins[id];
if (oldPlugin && oldPlugin.uninitialize) {
oldPlugin.uninitialize();
Expand Down

0 comments on commit 255e1a8

Please sign in to comment.