Chrome应用:窗口与其他窗口的HTML代码交互

时间:2015-07-08 13:01:44

标签: javascript html css google-chrome google-chrome-app

我正在编写一个应用程序,在其主窗口的javascript代码中创建一个新窗口。

Mainwindow.js:

chrome.app.window.create('sample.html', {
        id: 'newwindow',
        'bounds': {
          'width': 200,
          'height': 200
        },
        'resizable' : false,
        'alwaysOnTop' : true,
        'frame': { type: "none" }
    }, function(createdWindow) {
    /*here*/
})

sample.html:

<!DOCTYPE html>
<html>
 <head>
  <title>Chrome app</title>
  <link rel="stylesheet" type="text/css" href="style.css" />
 </head>
 <body>
  <div style='background-image: url("img1.png"); height: 50px; width: 200px;'>
 </body>
</html>

我想做的是与mainwindow.js中的sample.html代码进行交互,以便更改背景图像的路径。有没有办法做到这一点?

0 个答案:

没有答案