I just spend a few hours on this, so here’s a quick public not for anyone trying to do selenium testing on Microsoft Edge Chromium that runs into a popup for custom uri-handlers:
You can disable them by passing the following code-block as experimental options in microsoft edge.
{ "protocol_handler": {
"allowed_origin_protocol_pairs": {
"http://h2916922.stratoserver.net:8084.nl": {
"myUriHandler": true
}
}
}
}
Here’s my proof of concept / quick and dirty implementation in java:
EdgeDriver driver = null;
EdgeOptions opt=new EdgeOptions();
String protocolHandlerSetting=" {\"protocol_handler\": {\r\n"
+ " \"allowed_origin_protocol_pairs\": {\r\n"
+ " \"http://h2916922.stratoserver.net:8084\": {\r\n"
+ " \"myUriHandler\": true\r\n"
+ " }\r\n"
+ " }\r\n"
+ " }}";
opt.setExperimentalOption("prefs", new Gson().fromJson(protocolHandlerSetting, HashMap.class));
driver = new EdgeDriver(opt);
driver.get("http://h2916922.stratoserver.net:8084");
Enjoy!