llms-inline-header-scripts
-
Hello, recently installed LifterLMS on our site and still evaluating the product. The site owner noticed he’s unable to copy/paste text from the site. After digging in the page source, I found a script entitled “llms-inline-header-scripts” containing functionality to prevent copy/pasting outside of input/textareas. I figured this was part of the main LifterLMS plugin, so disabled the plugin and the script disappears. Here’s the script:
<script id="llms-inline-header-scripts" type="text/javascript"> ( function(){ function dispatchEvent( type ) { document.dispatchEvent( new Event( type ) ); } document.addEventListener( 'copy', function( event ) { // Allow copying if the target is an input or textarea element if (event.target.tagName === 'INPUT' || event.target.tagName === 'TEXTAREA') { return; // Let the default copy behavior proceed } // Prevent copying outside input/textarea elements event.preventDefault(); event.clipboardData.setData( 'text/plain', 'Copying is not allowed.' ); dispatchEvent( 'llms-copy-prevented' ); }, false ); document.addEventListener( 'contextmenu', function( event ) { // Prevent right-click context menu on images if ( event.target && 'IMG' === event.target.nodeName ) { event.preventDefault(); dispatchEvent( 'llms-context-prevented' ); } }, false ); } )(); </script>I appreciate why this functionality is there, but I would prefer to restrict this to the training course pages, rather than the entire site. Does anyone know if this is possible?
The page I need help with: [log in to see the link]
The topic ‘llms-inline-header-scripts’ is closed to new replies.