Skip to content

Instantly share code, notes, and snippets.

@liuliangsir
Forked from Gustavo-Kuze/force-ctrl-c-v.md
Created February 4, 2023 05:41
Show Gist options
  • Save liuliangsir/0bcdad9785ee25c19f4577aa8c99d466 to your computer and use it in GitHub Desktop.
Save liuliangsir/0bcdad9785ee25c19f4577aa8c99d466 to your computer and use it in GitHub Desktop.

Revisions

  1. @Gustavo-Kuze Gustavo-Kuze renamed this gist Oct 7, 2020. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion force-ctrl-c-v.js → force-ctrl-c-v.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    ``` javascript
    javascript:(function(){
    allowCopyAndPaste = function(e){
    e.stopImmediatePropagation();
    @@ -6,4 +7,5 @@ javascript:(function(){
    document.addEventListener('copy', allowCopyAndPaste, true);
    document.addEventListener('paste', allowCopyAndPaste, true);
    document.addEventListener('onpaste', allowCopyAndPaste, true);
    })();
    })();
    ```
  2. @Gustavo-Kuze Gustavo-Kuze revised this gist Apr 3, 2019. No changes.
  3. @Gustavo-Kuze Gustavo-Kuze created this gist Apr 3, 2019.
    9 changes: 9 additions & 0 deletions force-ctrl-c-v.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    javascript:(function(){
    allowCopyAndPaste = function(e){
    e.stopImmediatePropagation();
    return true;
    };
    document.addEventListener('copy', allowCopyAndPaste, true);
    document.addEventListener('paste', allowCopyAndPaste, true);
    document.addEventListener('onpaste', allowCopyAndPaste, true);
    })();