I am making a bot, and this bot is searching constantly but some times when it searches, an alert appears asking the user for access to their location. How do i check if this alert is present or better yet disable it?
So far i have tried to disable stuff through about:config:
var prefs = Components.classes["@mozilla.org/preferences-
service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.setIntPref("network.cookie.cookieBehavior", 4);
prefs.setBoolPref("privacy.donottrackheader.enabled", true);
prefs.setIntPref("permissions.default.geo", 2);
But alerts still pop up. I also tried making a new firefox profile with pre installed add-ons just to block dialog boxes and pop ups, but it still gives me dialog boxes.
I really am stumped this time. If you know how i can check if a page is alerting something with JS or Selenium python then please tell me cause at this point, that would help me a lot. If you know how to disable javascript alerts then that would be awesome.