I would like to disable find function. I have a text uploded and the users shuld read the whole text without cheats, like CTRL + F. I have already disabled CTRL + F. But I can open the find bar frome the browser menu.
I hope someone has an idea.
I would like to disable find function. I have a text uploded and the users shuld read the whole text without cheats, like CTRL + F. I have already disabled CTRL + F. But I can open the find bar frome the browser menu.
I hope someone has an idea.
It's not really an answer for your question but here is something better.
Just put a span with a space in the words, that should not searchable and make the span hidden. for example:
<p>"This is a te<span class="foo"> </span>st."</p>
and the css:
.foo{
font-size:0;
}
https://jsfiddle.net/y8g10jsr/
try to search for "test" with CTRL+F
You can degenate image based on you text on the fly with javascript library html2canvas. For example if you want to transform div with id docs
into image, your code will be
$(document).ready(function(){html2canvas($('#docs'), {
onrendered: function(canvas) {
$('#docs').html(canvas);
}
});});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script>
<div id="docs">This script allows you to take "screenshots" of webpages or parts of it, directly on the users browser. The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, but builds the screenshot based on the information available on the page.</div>
P.S. But user still will be able to see text if he will check html of the page
I've just tried this as a workaround and it seems to render the text unsearchable.
.overlook::after {
content: attr(data-text);
}
<p class="overlook" data-text="Ctrl+F will not find this">
Tested in Chrome, Firefox and IE.
edit:
Oh I hadn't seen the comment below the question - please up vote the original if you find this useful.