Articles on: 官網設計

如何移除複製與貼上的右鍵功能,避免網店內容遭盜用?

有關的文章: 官網設計


移除您網店前台內容被複製貼上之右鍵功能,您於網店前台之商品及背景圖片、文字內容皆無法被反白選擇及進行複製,避免您用心製作的圖片或是文字內容未經允許被使用,保障您重要的智慧財產權。

此篇文章,將能協助您:


一、移除右鍵複製貼上功能



二、取消  " 移除右鍵複製貼上功能 "



一、移除右鍵複製貼上功能


您可以前往「佈景主題」>「編輯原始碼」> 點選「layout」中的「theme.liquid」> 複製以下程式碼於 “  </body> “ 前:

   <script type="text/javascript">

$(document).ready(function () {

    $("body").css({

        "-webkit-touch-callout": "none",

        "-webkit-user-select": "none",

        "-khtml-user-select": "none",

        "-moz-user-select": "none",

        "-ms-user-select": "none",

        "user-select": "none"

    });

    //Disable cut copy paste

    $('body').bind('cut copy paste', function (e) {

        e.preventDefault();

    });

   

    //Disable mouse right click

    $("body").on("contextmenu",function(e){

        return false;

    });

});

</script>


二、「取消」移除右鍵複製貼上功能


只要回到「layout」中的「theme.liquid」> 移除新增之程式碼即可💪


更新時間: 19/09/2022

Updated on: 08/01/2024

這篇說明對您有幫助嗎?

Share your feedback

取消

感謝!