Open In App
Related Articles

HTML | DOM Navigator taintEnabled() Method

Improve Article
Improve
Save Article
Save
Like Article
Like

The Navigator taintEnabled() method was best avoided in JavaScript version 1.2, and has been deprecated since then to prevent run-time errors in the future. Data Tainting was a security feature to destroy or remove the highly infectious data used by JavaScript 1.2. It has been completely discarded by now; this method only available for maintaining compatibility with very old scripts with limited browser support. It returns a Boolean value that shows whether the browser has data tainting method enabled. The NavigatorID.taintEnabled() method would always returns Boolean false value.

Syntax:

window.navigator.taintEnabled()

Return Value:
It returns a Boolean value, specifying whether the browser has data tainting feature enabled.

Example: It would return true if data tainting is supported and enabled, and it returns false if the feature is disabled.




<!DOCTYPE html>
<html>
  
<head>
    <title>
        HTML DOM Navigator taintEnabled() Method
    </title>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
    <h2>HTML DOM Navigator taintEnabled() Method
  </h2>
  
    <p id="geeks"
       onclick="functionGFG()">
        Welcome to GeeksforGeeks!
    </p>
    <input type="button"
           value="Is data tainting in my browser enabled?"
           onClick="functionGFG()">
  
    <script language="JavaScript">
        function functionGFG() {
            
            // data tainting is enabled or not.
            var temp = navigator.taintEnabled();
            alert(window.navigator.taintEnabled());
        }
    </script>
  
</body>
  
</html>


Output:
Before Click:

After Click:

Supported Browsers:
This method has long been deprecated and beware before using it because at anytime it may be withdrawn. Despite being removed it is supported by the following browsers:

  • Opera 3.5
  • Internet Explorer 4.0/Edge.

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 19 Feb, 2019
Like Article
Save Article
Previous
Next
Similar Reads
Complete Tutorials