9
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

JavaScriptでPrintscreenによる画面キャプチャを無理やり無効にする方法

Last updated at Posted at 2015-12-15
disprintscreen.js
<script type="text/javascript" src="js/clipboard.js"></script>
<span style="display:none;"><button id="btnfake">Copy</button></span><div id="fake"> </div>
<script type="text/javascript">
window.addEventListener("keyup",kPress,false);
function kPress(e)
{ 
var c=e.keyCode||e.charCode; 
if (c==44)
changeBoard();
}
function changeBoard(){
	document.getElementById('btnfake').click();
};
</script>
<script>
    var clipboard = new Clipboard('#btnfake', {
        target: function() {
            return document.querySelector('#fake');
        }
    });
</script>

検索しても見つからなかったので無理やり自作しました。
前提条件としてclipboard.jsを利用しますのでご注意ください。

9
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?