LOADING
111 words
1 minute
Copy Protection Example

Post with Copy Protection Enabled

This post has all four copyProtection sub-options enabled in its frontmatter:

copyProtection:
blockSelection: true
blockClipboard: true
blockContextMenu: true
blockDevTools: true

The following protections are active on this page:

  • Block Selection — Text selection is disabled via user-select: none.
  • Block Clipboardcopy, cut, and paste events are intercepted and prevented.
  • Block Context Menu — Right-clicking is disabled.
  • Block DevToolsF12, Ctrl+U (view source), and Ctrl+S (save page) are blocked.

Options

OptionDescription
blockSelectionDisable text selection
blockClipboardBlock copy/cut/paste events
blockContextMenuBlock right-click menu
blockDevToolsBlock F12 / Ctrl+U / Ctrl+S

All sub-options default to false — enable only the protections you need.

Try It

Try selecting text, right-clicking, pressing Ctrl+C, or hitting F12 on this page — you’ll find all of these actions are blocked.

Copy Protection Example
/posts/copy-protection/
Author
Twilight
Published at
2022-11-01
License
CC BY-NC-SA 4.0

Some information may be outdated