Google Chrome包应用程序:如何制作透明的圆形背景,如谷歌环聊应用程序? [英] Google Chrome Package Apps : How to make transparent rounded background like google hangout app?

查看:255
本文介绍了Google Chrome包应用程序:如何制作透明的圆形背景,如谷歌环聊应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如下面的截图所示,环聊应用是完全透明的,并且应用了背景阴影。

As shown in the below screenshot, hangout app is fully transparent and it has background-shadow applied to it as well.

我尝试了几种没有运气的方法,将css样式应用于html和body标签,并在创建新窗口时使用frame:none选项,但不起作用。

I tried several approach with no luck by applying css styling to "html" and "body" tag to the page and by using "frame: none" option while creating new window, but it doesn't work.

如何制作Google Chrome包应用程序喜欢这个?

How to make Google chrome package app like this?

任何人都有任何想法?

这是我正在尝试的代码。

Here is the code on which I am experimenting.

mainfest.json:

{
  "manifest_version" : 2,
  "name" : "Demo App",
  "version" : "0.1",

  "description" : "Demo Purpose",
  "app" : {
    "background" : {
      "scripts" : ["background.js"]
    }
  },
  "permissions" : ["experimental"]
}

background.js

chrome.app.runtime.onLaunched.addListener(function() {
    chrome.app.window.create("index.html", {
        frame: "none",
        id: "DemoWindow",
        resizable : false,
        innerBounds : {
            left: 600,
            maxWidth: 150,
            maxHeight: 150
        }
    });
});

index.html

<!DOCTYPE html>
<html>
<head>

    <style type="text/css">
        .title-area {
            -webkit-app-region: drag;
        }
        html, body {
            margin: 0;
            padding: 0;
            border: none;
            outline: none;
            overflow: hidden;
            background-color: transparent;

        }
    </style>
</head>
<body>
<div class="title-area">Hello World</div>

</body>
</html>


推荐答案

很遗憾,您目前无法执行此操作。我们已将此环聊应用列入白名单,以便能够使用所需的API。

Unfortunately you can't currently do this. We have white-listed the hangouts app to be able to use the APIs needed for this.

将这些API打开给第三方有可能导致安全问题(具体来说,网络钓鱼和点击劫持攻击)。解决这些安全问题需要付出很大努力,因此我们希望在进行这项工作之前,看看API是否被认为对合作伙伴应用(环聊)有用。

Opening up these APIs to third parties has the potential for security problems (specifically, phishing and click jacking attacks). Solving these security issues will require a large effort, so we wanted to see if the API was considered useful with a partner app (hangouts) before undertaking that effort.

现在考虑我们的选项,并可能打开API直到第三方应用程序在未来。

We're now considering our options and may open the API up to third party apps in the future.

这篇关于Google Chrome包应用程序:如何制作透明的圆形背景,如谷歌环聊应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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