2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-12-27 19:54:54 +00:00
nativefier/app/assets/js/index.js
2015-07-05 14:08:13 +08:00

28 lines
595 B
JavaScript

/**
* Created by JiaHao on 5/7/15.
*/
var ipc = require('ipc');
ipc.on('params', function(message) {
var appArgs = JSON.parse(message);
console.log(appArgs.targetUrl);
console.log(appArgs.name);
document.title = appArgs.name;
var webView = document.createElement('webview');
webView.setAttribute('src', appArgs.targetUrl);
webView.setAttribute('autosize', 'on');
webView.setAttribute('minwidth', '600');
webView.setAttribute('minheight', '800');
var webViewDiv = document.getElementById('webViewDiv');
webViewDiv.appendChild(webView);
});