Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

How to remove the View Source action on the right click

337 views
Skip to first unread message

Frederic Thomas

unread,
Sep 25, 2012, 4:35:56 AM9/25/12
to appj...@googlegroups.com
Hi appjsers !

I am testing appjs to build html desktop applications. Congratulations for your work, it is an amazing technology !

I notice that on the right click, a "View Source" action exists.

Is-it possible to remove this action ? My end users do not care about my code in fact.

Fred

sihorton

unread,
Sep 25, 2012, 4:45:09 AM9/25/12
to appj...@googlegroups.com
Hi Frederic,

You can supply your own context menu in javascript / html to over-ride the built in one. So something along the lines of:

document.addEventListener('contextmenu', function(ev) { ev.preventDefault(); return false; }, false); 

So register to handle the "contextmenu" event and then make sure you prevent the default action.

/Simon
P.S. syntax might not be 100% since this is just from my memory but you can search for javascript right click or similar in google to get the right syntax.

Frederic Thomas

unread,
Oct 5, 2012, 8:38:38 AM10/5/12
to appj...@googlegroups.com
Simon,
It's working fine !

Thanks a lot.
Frederic

2012/9/25 sihorton <siho...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "appjs-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/appjs-dev/-/HAYUEa_A0IMJ.
To post to this group, send email to appj...@googlegroups.com.
To unsubscribe from this group, send email to appjs-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/appjs-dev?hl=en.

ikhwan nurudin

unread,
Feb 28, 2016, 2:18:36 PM2/28/16
to appjs-dev, fthom...@gmail.com
i have same problem,, but im still confuse. 
where i must paste or replace this code? 

<script>
document.addEventListener('contextmenu', function(ev) { ev.preventDefault(); return false; }, false); 
</script>
Reply all
Reply to author
Forward
0 new messages