Skip to content

Use MutationObserver to prevent DOM element deleted by user devtools.

Notifications You must be signed in to change notification settings

yuetong3yu/prevent-devtools-deleting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prevent using devtools to deleting your element

Recently I worked a company water-markup project. I found that the watermark that we generated could easily deleting by user's devtools. Somehow, we dont want that happened(I dont care actually, but company's resource would be stolen).

I think we could use MutationObserver to listening the target DOM(canvas or whatever you want), if deleting happened, we could recovered immediately.

Demo Useage

yarn && yarn dev

About

Use MutationObserver to prevent DOM element deleted by user devtools.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published