Confluence "switch back to mobile" links does not appear when used in desktop mode
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Fisheye および Crucible は除く
This article is about Confluence mobile web. It does not apply to the Confluence iOS app, which is available now for Confluence Cloud customers.
問題
After switching to desktop mode in the mobile phone browser, the link "switch back to mobile" mode does not appear at the top menu. Therefore the user is not able to switch back to the mobile mode in their browser.
回避策
The workaround is to manually add the link to switch back to mobile mode in your Confluence
- Go to Confluence Administrator >> Custom HTLM >> EDIT
- Add the following script in the header then save
<script type="text/javascript"> AJS.toInit(function() { Confluence.MobileSwitch = { switchToMobile: function(e) { AJS.$.cookie("confluence.mobile.desktop.switch", null, Confluence.MobileSwitch._cookieOptions); // this cookie name matches desktop-switch.js // remove the desktop=true request parameter if it is present if (window.location.href.match(/[?&;]desktop=true/)) { var href = window.location.href.replace(/desktop=true&?/,"") window.location = href; } else { window.location.reload(); } }, initialise: function() { $messageContainer = AJS.$("#messageContainer"); // If the element does not exist, it will be created. !$messageContainer.length && ($messageContainer = AJS.$("<ul id='messageContainer' />").appendTo("#header-precursor .cell")); $messageContainer.append(Confluence.Templates.Mobile.Switch.returnToMobileBanner()); Confluence.MobileSwitch._cookieOptions = { expires: 3650, path: AJS.Meta.get("context-path") || "/", raw: true }; $messageContainer.find("a").click(Confluence.MobileSwitch.switchToMobile); } }; Confluence.MobileSwitch.initialise(); }); </script>