Google Hangouts 扩展程序如何创建面板窗口? [英] How does the Google Hangouts extension create the panel window?

查看:19
本文介绍了Google Hangouts 扩展程序如何创建面板窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Doc 说如果你想创建一个面板窗口,你应该使用

The Doc says if you want to create a panel window ,you should use

chrome.windows.create({...,type:"panel"}, function callback)

同时,它说指定要创建的浏览器窗口的类型.除非设置了‘--enable-panels’标志,否则‘面板’类型会创建一个弹出窗口."

At the same time, it says "Specifies what type of browser window to create. The 'panel' type creates a popup unless the '--enable-panels' flag is set."

所以你应该去chrome://flags"手动更改它.但是 Google Hangouts 无需这样做就可以创建面板.它是如何做到的?

So you should go to "chrome://flags" to change it manually. But Google Hangouts can create the panel without doing that. How does it do that?

推荐答案

Google Hangouts 扩展程序(以前称为Chat for Google")明确是在源代码中列入白名单,这允许它即使 --enable-panels 标志未设置,也使用面板功能:

The Google Hangouts extension (formerly called "Chat for Google") is explicitly whitelisted in the source code, which allows it to use the panel feature even when --enable-panels flag is unset:

bool PanelManager::ShouldUsePanels(const std::string& extension_id) {
 ...
    return CommandLine::ForCurrentProcess()->HasSwitch(
        switches::kEnablePanels) ||
        extension_id == std::string("nckgahadagoaajjgafhacjanaoiihapd") ||
 ...

这篇关于Google Hangouts 扩展程序如何创建面板窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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