Here is how to prevent the installation of add-on in Firefox. You can completely disable the installation of xpi files (add-ons plug-ins or extensions) by configuring the browser.
Run your Firefox browser, type about:config in the address bar and press Enter key. Confirm the security warning and type ‘xpinstall’ in the Filter field and look for the ‘expinstall.enabled’ entry.
Double click on it or right click and select the context command ‘Toggle’ so that the value is changed to ‘False’. Close your browser.
Now onwards, Firefox will stop the installation of add-ons without any message. Reverse the procedure to re-enable the installation of add-ons.