Arandano Posted April 18, 2021 Share Posted April 18, 2021 My site uses v7.0. I was successful in blocking text selection for the whole site by injecting this code to "Code Injection": Quote <script> function disableselect(e) { return false; } function reEnable() { return true; } document.onselectstart = new Function("return false"); if (window.sidebar) { document.onmousedown = disableselect; document.onclick = reEnable; } </script> However, this did not work for the embedded Google Docs document and I was able to select the text inside both the code block and the embed block. I've also tried finding a solution from the Google Docs side, but there doesn't seem to be a way to stop this. Any suggestions? Link to comment
Spark_Plugin Posted April 18, 2021 Share Posted April 18, 2021 1. Add this to ”Custom CSS”: .disable-select { -webkit-touch-callout: none; user-select: none; } 2. Add this class to the embed code (iframe tag), should look something like this: <iframe class=”disable-select”> Let me know if it works😊 - Rasmus Myhrberg, Founder of Spark Plugin Spark Plugin – The Ultimate Design Toolkit for Squarespace Link to comment
Arandano Posted April 19, 2021 Author Share Posted April 19, 2021 (edited) Hi Rasmus, thanks for your answer. I tried it, but it didn't have the wanted effect. user-select is active, but I can still select the text inside the embedded code block. Edited April 19, 2021 by Arandano Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment