Any way to prevent right-click on table forms?

Aki18
Tera Contributor

I would like to prevent users' right-click on table forms, but is there any way? I think it depends on web browser, though.

 

Best Regards,

Aki

13 REPLIES 13

PrashantLearnIT
Tera Sage

Hi @Aki18 

 

Ideally, that's not recommended, but can you please explain what you are trying to achieve?

Hi @PrashantLearnIT ,


Thank you for your reply. I would like to prevent users from checking page source of the record.

Aki18_0-1762348077991.png

 

Hi @Aki18 

 

That’s browser-level, not from ServiceNow, so we can’t control it much here.

 

@PrashantLearnIT 

I created the following onLoad Client Script for Incident table with "Isolate script" = "false" and it successsfully blocked the browser's right-click.
However, it didn't work when I created the script for custom table in the custom app. Does anyone know why it doesn't work?

function onLoad() {
  document.addEventListener('contextmenu', event => event.preventDefault());
}