I'm using the following script to hide elements of the confluence page for a specific user. However, I would like to use this for the specified user and anonymous access. How can I change this script to do this? IS it possible to have scripts that provide different views? Example, the one below for the specified user ID and another for another ID?
<script>
AJS.toInit(function(){
if (AJS.params.remoteUser == 'ctsidocs'){
AJS.$("#space-tools-menu-trigger").hide();
AJS.$('#header').hide();
AJS.$('#action-menu-link').hide();
AJS.$('#children-section').hide();
AJS.$('#shareContentLink').hide();
AJS.$('#likes-section').hide();
AJS.$('#labels-section').hide();
AJS.$('#watch-content-button').hide();
}
});
</script>