DESCRIPTION OF PROBLEM
We have developed an online reader where pdf and epub books are rendered and read. In the reader on the selection of text, we present "highlight" and "note" context menus. After the iOS version is updated to 13.1, on the long-press context menu event is not triggering in the browser and it is displaying the default browser context menu. Which we don't want. We want to hide these context menus from online reader.
Expected solution
- How to hide the default context menu?
- How to override the existing default context menu so that we can alter it?
Steps to reproduce
- Open https://scholarbeta.ipublishcentral.com/epubreader/new-world-power68680%C2%A0in iPhone/ iPad safari.
- Login with impelsys / impelsys
- Select a few lines of text in the reader using a long press.
- You can observe the default content menu (Copy | Look up|Share| ) provided by the browser. We have to hide it or alter it.
I am attaching a sample HTML code block end of this query.
Just wanted to highlight that contextmenu listener is triggered in macOS machines. It is only failing in iPhone/iPad devices running iOS 13.1 and above.
We need immediate help with this issue since many of our client facing this issue and it is a copyright violation and against our DRM policy.
<!DOCTYPE html>
<html>
<head>
<style>
div {
background: yellow;
border: 1px solid black;
padding: 10px;
}
</style>
</head>
<body>
<div id="myDIV">
<p>Right-click inside this box to see the context menu!
</div>
<script>
document.getElementById("myDIV").addEventListener("contextmenu", myFunction);
function myFunction() {
alert('context menu fired');
}
</script>
</body>
</html>