Remove "Display secure content only" option
allowDisplayingInsecureContent is removed in Electron 1.6. And it's no longer necessary to show http contents in https server.
This commit is contained in:
@@ -12,7 +12,6 @@ const preloadJS = `file://${remote.app.getAppPath()}/browser/webview/mattermost_
|
||||
|
||||
const MattermostView = React.createClass({
|
||||
propTypes: {
|
||||
disablewebsecurity: React.PropTypes.bool,
|
||||
name: React.PropTypes.string,
|
||||
id: React.PropTypes.string,
|
||||
onTargetURLChange: React.PropTypes.func,
|
||||
@@ -38,12 +37,6 @@ const MattermostView = React.createClass({
|
||||
var self = this;
|
||||
var webview = findDOMNode(this.refs.webview);
|
||||
|
||||
// This option allows insecure content, when set to true it is possible to
|
||||
// load content via HTTP while the mattermost server serves HTTPS
|
||||
if (this.props.disablewebsecurity === true) {
|
||||
webview.setAttribute('webpreferences', 'allowDisplayingInsecureContent');
|
||||
}
|
||||
|
||||
webview.addEventListener('did-fail-load', (e) => {
|
||||
console.log(self.props.name, 'webview did-fail-load', e);
|
||||
if (e.errorCode === -3) { // An operation was aborted (due to user action).
|
||||
@@ -218,10 +211,6 @@ const MattermostView = React.createClass({
|
||||
errorInfo={this.state.errorInfo}
|
||||
/>) : null;
|
||||
|
||||
// 'disablewebsecurity' is necessary to display external images.
|
||||
// However, it allows also CSS/JavaScript.
|
||||
// So webview should use 'allowDisplayingInsecureContent' as same as BrowserWindow.
|
||||
|
||||
// Need to keep webview mounted when failed to load.
|
||||
return (
|
||||
<div>
|
||||
|
Reference in New Issue
Block a user