I tried placing a transparent box over all my text, as someone from another forum suggested but that did not stop CTRL + A (which highlights everything in given space) to work. Is it possible to just disable selection of text in general? If you are thinking of giving me a code that will work, I would also appreciate a small list of instructions because I have not used Corvid yet and am unsure about its operation.
Hi,
Currently, the best solution to protect the content of your site from being copied is Right Click protect app .
Note that even if the text canât be copied, visitors can still make a print screen of you site and get the text using 3rd party software.
Hi Aleks, I use the Right Click protect app but still the text content can be easily copied by selecting the text and using ctrl + c. I want to disable this. Can you help?
Hi, Aleks. I have the same problem. Any solution to this?
Yeah Iâd love to know that too?
For textfields, inputfields, and RichTextfield, you have the option â> onKeypress
$w("#myElement").onKeyPress( (event) => {
let pressedKey = event.key; // "A"
let shift = event.shiftKey; // true
let meta = event.metaKey; // false
let alt = event.altKey; // false
let ctrl = event.ctrlKey; // false
let value = event.target.value; // "SE"
} );
You could make an if-query⌠(example)
exportfunction inputFieldID_keyPress(event) {
let pressedKey = (event.key)
if(pressedKey==="c" && pressedKey===ctrl) {"Do nothing"}
else {doSomething()}
}
What am I doing wrong?
I am getting "âctrlâ is not defined "on line 3, ââdoSomethingâ is not definedâ on line 4 and ââonKeyPressâ does not exist on â#text24ââ on line 6.
export function text24_KeyPress(event) {
let pressedKey = (event.key)
if(pressedKey==="c" && pressedKey===ctrl) {"Do nothing"}
else {doSomething()}
}
$w("#text24").onKeyPress( (event) => {
let pressedKey = event.key; // "A"
let shift = event.shiftKey; // true
let meta = event.metaKey; // false
let alt = event.altKey; // false
let ctrl = event.ctrlKey; // false
let value = event.target.value; // "SE"
} );
Would love to hear on this. I should be able to protect my content from being copied using any means. The right-click protect App could be useless as users can highlight and do ctrl=c. Would be great if you can send a code and a step by step guide on how to implement the same.
@michaelr The âTextâ type doesnât support keyboard events.
Look at the below image to understand.
A KeyboardEvent event occurs only when the user presses a key while the cursor is located inside a TextInput, TextBox, or RichTextBox.
Note that the âTextâ type is different from the aforementioned types.
Itâs supported HTML tags are:
-
-
,
,
,
,
, and
-
- ,
-
- , and
âonKeyPressâ function and âctrlâ property being a KeyboardEvent function and property respectively are not supported by the âTextâ type. Thatâs why you were facing those errors.
As far as the âdoSomethingâ function goes, itâs undefined in the script you have provided. Create that function and provide a body to it or remove the else part from the logic to remove the error.
I hope this clarifies.
Hi Megumin.
I spent a whole day to no avail in order to find a solution for this using Corvid.
I have also tried generic scripts using inline styles or js/jquery snippets to arrive at an answer.
No luck
my solution
create an event in text, page or any element that wants to put the protection of ctrl c, v
and add the event
export function text1_mouseIn (event) {
wixWindow.copyToClipboard (âCopehightâ)
}
export function text1_mouseOut (event) {
wixWindow.copyToClipboard (âCopehightâ)
}
this way when the staff hover over the text to select, the word âCopehightâ will be automatically transferred to their clipboard and when removing the mouse from the text the same thing will happen,
an easier way to make this work for the home page would be to put it this way
export function page1_mouseIn (event) {
wixWindow.copyToClipboard (âCopehightâ)
}
export function page1_mouseOut (event) {
wixWindow.copyToClipboard (âCopehightâ)
}
this way the user may even be able to copy the text, but when he leaves the page to paste, the word âCopehightâ will be automatically transferred to his clipboard
one way that you can get around this would be using the keys
win + v, which shows all the copied things, this way they can still paste
but in any case, it would be a way to make improper coping difficult
Could you be more detail ? I try but it did not work
import wixWindow from âwix-windowâ ;
export function YourTextToProtect _mouseOut ( event ) {
wixWindow . copyToClipboard ( âCopehightâ )
}
export function YourPageToProtect _mouseOut ( event ) {
wixWindow . copyToClipboard ( âCopehightâ )
}
hi, thank you! it workeddd!!!
do you know how do i hide the banner that appears after someone mouseout? @kaio12_peba
@kaio12_peba your solution worked, however I used lot of strips and each strips includes lot of text. So Do I need to define Mouse out events for each strip ?
Also How to hide banner which appears on the webpage once the text is copied to clipboard ?
Hi,
Iâd like to know if there is any update on this poste after a year now.
I tried all the proposed solution from the comments but nothing seems to work.
I have a lot of text that I wouldnât like to be copied by others. The right click protection is clearly not enough.
Thanks in advance
Have you found a solution to the pop up banner every time you move your mouse outside of the element. I am also struggling to resolve this.