Google Chrome无框架(如自助服务终端)

时间:2016-09-13 07:59:08

标签: google-chrome google-chrome-extension

我想知道是否可以让Google Chrome的行为像信息亭(没有框架或控件),但不能全屏显示,如下一个模拟图片:

Example

2 个答案:

答案 0 :(得分:2)

我在Electron的解决方案:

var app = require('app');  // Module to control application life.
var BrowserWindow = require('browser-window');  // Module to create native browser window.

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is GCed.
var mainWindow = null;

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
app.on('ready', function() {
 // Create the browser window.
 mainWindow = new BrowserWindow({width: 800, height: 600, frame:false});

 // and load the index.html of the app.
 mainWindow.loadURL('http://www.google.com/');

 // Emitted when the window is closed.
 mainWindow.on('closed', function() {
   // Dereference the window object, usually you would store windows
   // in an array if your app supports multi windows, this is the time
   // when you should delete the corresponding element.
   mainWindow = null;
 });
});

答案 1 :(得分:1)

我认为不可能让Chrome本身表现那样,但Chrome App(不是扩展程序)可以做到这一点。

这是窗口创建中的option

chrome.app.window.create("app.html", {
  frame: "none"
});

请注意,您必须提供自己的控件才能关闭/移动窗口。

要使其行为类似于浏览器,您需要嵌入<webview> element。另请参阅browser app example

但请注意Chrome Apps are being deprecated

您应该考虑使用类似的平台,例如ElectronNW.js来构建您自己的&#34;迷你浏览器&#34;为了你的目的。