diff --git a/app/extensions/brave/locales/en-US/app.properties b/app/extensions/brave/locales/en-US/app.properties index 5c11eeac33..c923bb0ad4 100644 --- a/app/extensions/brave/locales/en-US/app.properties +++ b/app/extensions/brave/locales/en-US/app.properties @@ -224,6 +224,7 @@ dismissDenyRunInsecureContent=Stay Insecure denyRunInsecureContent=Stop Loading Unsafe Scripts runInsecureContentWarning=This page is trying to load scripts from insecure sources. If you allow this content to run, it may transmit unencrypted data to other sites. denyRunInsecureContentWarning=Your connection is not private. This page is currently loading scripts from insecure sources. +viewCertificate=View Certificate windowCaptionButtonMinimize=Minimize windowCaptionButtonMaximize=Maximize windowCaptionButtonRestore=Restore Down diff --git a/js/actions/webviewActions.js b/js/actions/webviewActions.js index de159b09a8..65d27f6ad1 100644 --- a/js/actions/webviewActions.js +++ b/js/actions/webviewActions.js @@ -41,6 +41,16 @@ const webviewActions = { } }, + /** + * Shows the certificate infomation + */ + showCertificate: function () { + const webview = getWebview() + if (webview) { + webview.showCertificate() + } + }, + /** * Shows the definition of the selected text in a pop-up window (macOS only) */ diff --git a/js/components/siteInfo.js b/js/components/siteInfo.js index 16fe6b5cdb..3a3810cd41 100644 --- a/js/components/siteInfo.js +++ b/js/components/siteInfo.js @@ -9,14 +9,17 @@ const cx = require('../lib/classSet') const Dialog = require('./dialog') const Button = require('./button') const appActions = require('../actions/appActions') +const webviewActions = require('../actions/webviewActions') const messages = require('../constants/messages') const siteUtil = require('../state/siteUtil') +const platformUtil = require('../../app/common/lib/platformUtil') class SiteInfo extends ImmutableComponent { constructor () { super() this.onAllowRunInsecureContent = this.onAllowRunInsecureContent.bind(this) this.onDenyRunInsecureContent = this.onDenyRunInsecureContent.bind(this) + this.onViewCertificate = this.onViewCertificate.bind(this) } onAllowRunInsecureContent () { appActions.changeSiteSetting(siteUtil.getOrigin(this.location), @@ -30,6 +33,10 @@ class SiteInfo extends ImmutableComponent { ipc.emit(messages.SHORTCUT_ACTIVE_FRAME_LOAD_URL, {}, this.location) this.props.onHide() } + onViewCertificate () { + this.props.onHide() + webviewActions.showCertificate() + } get isExtendedValidation () { return this.props.frameProps.getIn(['security', 'isExtendedValidation']) } @@ -80,6 +87,12 @@ class SiteInfo extends ImmutableComponent { } let connectionInfo = null + let viewCertificateButton = null + // TODO(Anthony): Hide it until muon support linux + if (!platformUtil.isLinux()) { + viewCertificateButton = +