Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to prevent clickjacking in react js

// Won't render the application if WebApp is under Clickjacking attack
if(window.self === window.top) {
  ReactDOM.render(<WrappedApp />, document.getElementsByClassName('app')[0]);
} else{
  ReactDOM.render(<UnsecuredPage />, document.getElementsByClassName('app')[0]);
}
 
PREVIOUS NEXT
Tagged: #prevent #clickjacking #react #js
ADD COMMENT
Topic
Name
8+6 =