jjzjj

javascript - 谷歌浏览器包应用程序 : How to make transparent rounded background like google hangout app?

coder 2023-08-03 原文

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

我尝试了几种方法,但没有成功,将 css 样式应用于页面的“html”和“body”标记,并在创建新窗口时使用“frame: none”选项,但它不起作用。

如何制作这样的谷歌浏览器包应用程序?

有人知道吗?

这是我正在试验的代码。

ma​​infest.json :

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

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

背景.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。

向第三方开放这些 API 可能会带来安全问题(特别是网络钓鱼和点击劫持攻击)。解决这些安全问题需要付出很大的努力,因此我们想在着手解决之前先看看该 API 是否被认为对合作伙伴应用程序(视频群聊)有用。

我们现在正在考虑我们的选择,并可能在未来向第三方应用程序开放 API。

关于javascript - 谷歌浏览器包应用程序 : How to make transparent rounded background like google hangout app?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27804315/

有关javascript - 谷歌浏览器包应用程序 : How to make transparent rounded background like google hangout app?的更多相关文章

随机推荐