Merge branch 'security-improvements'

For #220
This commit is contained in:
Yuya Ochiai
2016-08-09 01:10:19 +09:00
5 changed files with 40 additions and 2 deletions

View File

@@ -1,5 +1,9 @@
'use strict';
window.eval = global.eval = function() {
throw new Error("Sorry, Mattermost does not support window.eval() for security reasons.");
}
const React = require('react');
const ReactDOM = require('react-dom');
const ReactBootstrap = require('react-bootstrap');
@@ -428,7 +432,7 @@ var MattermostView = React.createClass({
// Need to keep webview mounted when failed to load.
return (<div>
{ errorView }
<webview id={ this.props.id } className="mattermostView" style={ this.props.style } preload="webview/mattermost.js" src={ this.props.src } ref="webview"></webview>
<webview id={ this.props.id } className="mattermostView" style={ this.props.style } preload="webview/mattermost.js" src={ this.props.src } ref="webview" nodeintegration="false"></webview>
</div>);
}
});

View File

@@ -1,5 +1,9 @@
'use strict';
window.eval = global.eval = function() {
throw new Error("Sorry, Mattermost does not support window.eval() for security reasons.");
}
const {remote, ipcRenderer} = require('electron');
const settings = require('../common/settings');

View File

@@ -4,6 +4,10 @@ const electron = require('electron');
const ipc = electron.ipcRenderer;
const notification = require('../js/notification');
window.eval = global.eval = function() {
throw new Error("Sorry, Mattermost does not support window.eval() for security reasons.");
}
var hasClass = function(element, className) {
var rclass = /[\t\r\n\f]/g;
if ((' ' + element.className + ' ').replace(rclass, ' ').indexOf(className) > -1) {