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:
Yuya Ochiai
2017-03-18 21:25:46 +09:00
parent b1d586e9da
commit f08db8c72b
7 changed files with 1 additions and 80 deletions

View File

@@ -36,7 +36,6 @@ const styles = {
const MainPage = React.createClass({
propTypes: {
disablewebsecurity: React.PropTypes.bool.isRequired,
onUnreadCountChange: React.PropTypes.func.isRequired,
teams: React.PropTypes.array.isRequired,
onTeamConfigChange: React.PropTypes.func.isRequired,
@@ -291,7 +290,6 @@ const MainPage = React.createClass({
style={self.visibleStyle(isActive)}
src={team.url}
name={team.name}
disablewebsecurity={this.props.disablewebsecurity}
onTargetURLChange={self.handleTargetURLChange}
onUnreadCountChange={handleUnreadCountChange}
onNotificationClick={handleNotificationClick}

View File

@@ -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>

View File

@@ -107,7 +107,6 @@ const SettingsPage = React.createClass({
teams: this.state.teams,
showTrayIcon: this.state.showTrayIcon,
trayIconTheme: this.state.trayIconTheme,
disablewebsecurity: this.state.disablewebsecurity,
version: settings.version,
minimizeToTray: this.state.minimizeToTray,
notifications: {
@@ -151,12 +150,6 @@ const SettingsPage = React.createClass({
handleCancel() {
backToIndex();
},
handleChangeDisableWebSecurity() {
this.setState({
disablewebsecurity: this.refs.disablewebsecurity.props.checked
});
setImmediate(this.startSaveConfig);
},
handleChangeShowTrayIcon() {
var shouldShowTrayIcon = !this.refs.showTrayIcon.props.checked;
this.setState({
@@ -272,21 +265,6 @@ const SettingsPage = React.createClass({
</Checkbox>);
}
options.push(
<Checkbox
key='inputDisableWebSecurity'
id='inputDisableWebSecurity'
ref='disablewebsecurity'
checked={!this.state.disablewebsecurity}
onChange={this.handleChangeDisableWebSecurity}
>{'Display secure content only'}
<HelpBlock>
{'If enabled, the app only displays secure (HTTPS/SSL) content.'}
{' '}
{'If disabled, the app displays secure and non-secure (HTTP) content such as images.'}
</HelpBlock>
</Checkbox>);
if (process.platform === 'darwin' || process.platform === 'win32') {
const TASKBAR = process.platform === 'win32' ? 'taskbar' : 'Dock';
options.push(

View File

@@ -95,7 +95,6 @@ const initialIndex = parsedURL.query.index ? parseInt(parsedURL.query.index, 10)
ReactDOM.render(
<MainPage
disablewebsecurity={AppConfig.data.disablewebsecurity}
teams={AppConfig.data.teams}
initialIndex={initialIndex}
onUnreadCountChange={showUnreadBadge}

View File

@@ -18,7 +18,6 @@ function loadDefault(version) {
teams: [],
showTrayIcon: false,
trayIconTheme: 'light',
disablewebsecurity: true,
minimizeToTray: false,
version: 1,
notifications: {