web-page-secure

1.1.1 • Public • Published

web-page-secure

🔗 https://www.npmjs.com/package/web-page-secure

This is a baseline and extra light JS package that:

  • blocks Keyboard (key) actions -> Ctrl +

    • A: select all action on the page
    • C: copy action on the page
    • F: find content on the page
    • P: print webpage
    • S: save entire webpage as HTML
    • U: view source of webpage
  • disables context menu : right click (except for anchor elements to allow opening of links in new tab)

  • full page content selection

  • drag and drop content from page and hence prevents saving items on desktop

  • disables shortcut to debugger console (f12)

Installation:

npm install web-page-secure

Usage:

import { webPageSecure } from 'web-page-secure'

webPageSecure({
  disableDragElements: true,
  disableContentSelection: true,
  disableRightClick: true,
  disablePrint: true,
  disableCtrlActions: ['all'] 
  // enable master list as mentioned above. 
  // To block specific actions, pass an array with keys to be blocked
  // Master List : ['a', 'c', 'f', 'p', 's', 'u', 'x', 'i', 'j', 'v','f12']
})

Roadmap:

  • Cross browser fixes (this is a cross-browser script but there are some old browsers which need support and hence this script needs further extension)

  • Streamline build from git to npm.

Package Sidebar

Install

npm i web-page-secure

Weekly Downloads

1

Version

1.1.1

License

ISC

Unpacked Size

7.87 kB

Total Files

3

Last publish

Collaborators

  • sranka23