Support » Plugin: LoginPress | Custom Login Page Customizer » Is possibile to “protect” the background image?

  • Resolved peopleinside

    (@peopleinside)


    Hi,
    as background login image I use a picture that I don’t wanna be clickable and downloadable.

    Usually I protect images download with the CSS

    img {
    	pointer-events: none;
    }

    But this seems is not working for the background image on LoginPress.
    Any suggestion on how I can do this: disable the saving right click button only on the login background image?

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Abdul Wahab

    (@abdulwahab610)

    Hey, @peopleinside

    It is an unusual request. The img selector will not work here using CSS because here we use the background-image property in CSS instead of the image tag.

    Our developers have created the solution for you. Right-click is worked on the form only. Here it is in action [ Helping Screencast => https://d.pr/v/EBfrMm ]

    To achieve the above functionality just copy and paste the following JS snippet in LoginPress > Custom CSS/JS > JS. Helping Doc

    document.addEventListener("contextmenu", function(e){
        if (e.target.nodeName === "BODY") {
            e.preventDefault();
        }
    }, false);

    If you need any assistance do let us know.

    Thank you.

    Thread Starter peopleinside

    (@peopleinside)

    @abdulwahab610 Thank you!
    This is easy to bypass, no possibility to protect with pointer event none?

    Anyway is better than nothing this code.

    • This reply was modified 4 months, 2 weeks ago by peopleinside.
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.