Disable global context menu to prevent 'Save As'
This commit is contained in:
parent
67b2684f64
commit
8d95d5eb93
11
src/App.jsx
11
src/App.jsx
@ -25,6 +25,17 @@ function ScrollToTopComp() {
|
||||
}
|
||||
|
||||
function App() {
|
||||
// Global Content Protection
|
||||
useEffect(() => {
|
||||
const handleContextMenu = (e) => {
|
||||
e.preventDefault();
|
||||
};
|
||||
document.addEventListener('contextmenu', handleContextMenu);
|
||||
return () => {
|
||||
document.removeEventListener('contextmenu', handleContextMenu);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Router>
|
||||
<ScrollToTopComp />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user