Disable right-click (context) menu in HTML5 viewer

347 views
Skip to first unread message

Matt Parizeau

unread,
Aug 28, 2014, 12:31:40 PM8/28/14
to pdfnet-w...@googlegroups.com
Q:

We would like to remove the default right-click (context) menu in WebViewer as we are implementing our own. Is this possible?

A:

You can do it by adding the following code in a config file:
Tools.Tool.prototype.contextMenu = function(e) {
    e
.preventDefault();
};

Aaron

unread,
May 29, 2015, 12:44:02 PM5/29/15
to pdfnet-w...@googlegroups.com
The above code works for older WebViewer versions that didn't have a custom context menu. You'll also have to add one more line to get rid of our custom context menu as well as the default browser context menu.

Tools.Tool.prototype.contextMenu = function(e) {
    e
.preventDefault();
};
ReaderControl.prototype.setContextMenu = function() {};




Reply all
Reply to author
Forward
0 new messages