打印时如何禁用ChromeVox UI?

时间:2019-03-18 21:34:06

标签: google-chrome-extension accessibility wai-aria screen-readers blind

在屏幕上被选中时,用于Google Chrome浏览器的ChromeVox extension会在内容周围显示橙色轮廓。

打印网页时也会打印此橙色轮廓。查看下面的按钮如何用橙色轮廓选择,然后也出现在打印预览中。

如何在打印时禁用此橙色对焦环?

ChromeVox orange focus ring in print dialog

1 个答案:

答案 0 :(得分:0)

通过打印CSS媒体查询解决了该问题!

ChromeVox将标记和样式注入页面的body中,如下所示:

<div aria-hidden="true" class="cvox_indicator_container  ...more classes...">
...more html markup...
</div>

因此,我更新了全局CSS样式表,使其包含以下内容:

@media print {
  .cvox_indicator_container {
    display: none;
  }
}

哪个做得很棒。

然后我开始思考,即使ChromeVox将CSS更改为具有更高的特异性,我也要确保这不会改变。

然后,我将CSS更新为:

@media print {
  html body div.cvox_indicator_container {
    display: none !important;
  }
}

注意:这可能有些矫kill过正,但肯定具有更多的特异性。

理想情况下,ChomeVox团队会在其代码中添加类似此解决方案的内容。我试图找到他们的开放源代码回购…接近但失败了。 ?