Hide/disable the Printer Friendly Version icon

Community Alums
Not applicable

I have a requirement to remove or hide the 'Printer friendly version' option from within settings (the cog at the top right of the screen). 

We tried a UI Script to accomplish this which somewhat works. When a user goes to the cog the printing option is hidden, but if the user changes their selection from the 'general' tab to another option, then back to 'general', the 'printer friendly version' option is back. 

In lieu of a system property which doesn't exist, is anyone able to suggest a method to permanently hide it?

Current UI Script:

addLoadEvent(removeIcon);
function removePrint() {
    try {
        if($j("printer-friendly")) {
             $j('printer-friendly', parent.document).hide();
        }
    } catch (e) {
      //
    }
}

 

4 REPLIES 4

Filipe Cruz
Kilo Sage
Kilo Sage

Hi James,

Try this code on the ui script:

Event.observe(window, 'load', function() {
var x= $$('a')[9];
x.style.display = 'none';
});

 

Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Best Regards,

Filipe Cruz

Community Alums
Not applicable

Thanks Filipe

I should have mentioned in my original post that I had already tried that solution. I saw that exact code in a 9yr old post from yonu29. It doesn't work, unfortunately. 

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Inform your customer that this is not recommended and nothing exists OOB to hide it always.

I won't recommend using DOM manipulation to hide it even if it works as using DOM is not good practice.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Community Alums
Not applicable

Yep, I'm well aware of that and have indeed had those conversations. There are security considerations which I can't get into.

I may have to look at logging to see if at the very least we can log anytime the feature is used.