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

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

问题描述

在Chrome中执行我的量角器测试时,我收到类似于以下内容的警报:

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

希望这会有所帮助.

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

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