0

I am using the Responsive-UI Package for Sharepoint Online (Office 365). Because of this more responsive framework, I would like to fully disable the OOTB mobile view so our iPad users do not have to "switch to PC view" upon arriving at our site(s).

Despite disabling the Mobile Browser View through the following:

Site Settings > Site Features > Mobile Browser View [DISABLED]

I am still seeing the mobile view intermittently. Is there additional configuration to fully remove this functionality?

1

To achieve the goal, please change “?mobile=1” to “?mobile=0” at the end the URL on mobile device. here is the client script someone wrote for the same:

function fixMobileLinks {
    var qMobile = $().SPServices.SPGetQueryString()["mobile"];
    if (qMobile == "0") {
        var siteCollectionUrl = "http://mySiteCol";
        var jLink = 'a[href*="' + siteCollectionUrl + '"]';

        $("#s4-workspace").on("click", jLink, function () {
            var $link = $(this);                
            var href = $link.attr('href');
            href = updateQueryStringParameter(href, "mobile", "0");
            location.href = href;
            return false;           
        });
    }
}

function updateQueryStringParameter(uri, key, value) {
    var re = new RegExp("([?|&])" + key + "=.*?(&|$)", "i");
    separator = uri.indexOf('?') !== -1 ? "&" : "?";
    if (uri.match(re)) {
        return uri.replace(re, '$1' + key + "=" + value + '$2');
    }
    else {
        return uri + separator + key + "=" + value;
    }
}

Disable SharePoint Mobile in Office 365

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.