JavaScript How to override navigator.plugins in javascript? override navigator.plugins

How to override navigator.plugins in javascript?
There is a web site that reads my plugins list using with navigator.plugins and i don't want let them read my plugins and i want to show them fake plugins list.
How can i do that?

I know this is duplicate, but i'm not satisfied with this one :
How to override navigator.plugins in javascript or how to set it null?

For override a function in javascript we can act like this :

<script type="text/javascript">
    window.DoStuff = function () {
        alert("bar");   //this is the override
    };

    function DoStuff() {
        alert("foo");   //this is the original, occuring later in the page
    };
</script>

But what about navigator.plugins?
Here is the way we read those plugins list :

if (navigator.plugins && navigator.plugins.length) {
    for (var v = "", w = 0; w < navigator.plugins.length; w++) {
        var x = navigator.plugins[w].name; -1 != x.indexOf("Java") && (t = !0);
        v += x + "\r\n"
    }
 alert(v);
}

As you see that web site is a malicious web site and want to know installed plugins for some reasons.
How can i bypass them?


Edit base on first answer :
So how can we change their codes with a js function and replace new plugins list with main list?
In this way there is no need to change read-only window.navigator.plugins!

Answer:1

I've never written a promise before but I feel like this code communicates my intent. Question: How can I asynchronously fire off matchData() and countData() in the init block, after my http request ...

I've never written a promise before but I feel like this code communicates my intent. Question: How can I asynchronously fire off matchData() and countData() in the init block, after my http request ...

I cannot make the ratings element displayed. It simply does not appear. All other things work fine enough I have linked these properly: Semantic UI CSS (http://semantic-ui.com/dist/semantic.min.css) ...

I cannot make the ratings element displayed. It simply does not appear. All other things work fine enough I have linked these properly: Semantic UI CSS (http://semantic-ui.com/dist/semantic.min.css) ...

I want to create a search bar for my website where it can detect input from the user in the form of typing. How do I start going about this such that when the user starts typing he/she immediately ...

I want to create a search bar for my website where it can detect input from the user in the form of typing. How do I start going about this such that when the user starts typing he/she immediately ...

My goal: If the Camera button on my site is clicked > open the smartphone Camera > take a picture from a qr-code > resize it with js > load the picture on my server > read the qr-code > give me the ...

My goal: If the Camera button on my site is clicked > open the smartphone Camera > take a picture from a qr-code > resize it with js > load the picture on my server > read the qr-code > give me the ...