如何禁用“始终在相关应用程序中打开这些类型的链接"铬警报 [英] How to disable "always open these types of links in the associated app" Chrome alert

查看:27
本文介绍了如何禁用“始终在相关应用程序中打开这些类型的链接"铬警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Chrome 中执行 Protractor 测试时,我收到类似于以下的警报:

While executing my Protractor tests in Chrome I'm getting an alert similar to below:

我想接受它以便能够继续我的测试执行.

I want to accept it to be able to continue with my tests execution.

首先我尝试了 browser.switchTo().alert().accept(),但没有成功.

First I've tried with browser.switchTo().alert().accept() but it didn't work.

然后我google了一下,找到了以下解决方案:

Then I google'd a bit and found the following solution:

chromeOptions: { 
      prefs: { 
        protocol_handler: { 
          excluded_schemes: { 
            "app": true 
          } 
        } 
      },

但它也不起作用.

我需要能够接受这一点才能执行剩余的测试步骤.

I need to be able to accept that in order to execute remaining test steps.

推荐答案

我是 Protractor 的新手,如果有任何语法错误请见谅.以下 Chrome 选项应该有助于禁用始终在相关应用中打开这些类型的链接"弹出窗口.

I am new to Protractor and please excuse me if there are any syntax errors. Following Chrome options should help in disabling the "Always open these type of links in the associated app" popup.

capabilities: {
  browserName: 'chrome',
  acceptInsecureCerts: true,

  'chromeoptions': {
        prefs: {
          'protocol_handler.excluded_schemes.XYZ': false,
        }
      }
},

注意:XYZ 是您应用的协议名称(通过它打开链接),您可以从注册表编辑器的HKEY_CLASSES_ROOT"中获取它

Note: XYZ is a protocol name of your app (through which the link is being opened), which you can get it from "HKEY_CLASSES_ROOT" in registry editor

希望这会有所帮助.

这篇关于如何禁用“始终在相关应用程序中打开这些类型的链接"铬警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆