Ignore did-fail-load event when trying to use U2F devices
This commit is contained in:
@@ -16,6 +16,9 @@ const ErrorView = require('./ErrorView.jsx');
|
|||||||
|
|
||||||
const preloadJS = `file://${remote.app.getAppPath()}/browser/webview/mattermost_bundle.js`;
|
const preloadJS = `file://${remote.app.getAppPath()}/browser/webview/mattermost_bundle.js`;
|
||||||
|
|
||||||
|
const ERR_NOT_IMPLEMENTED = -11;
|
||||||
|
const U2F_EXTENSION_URL = 'chrome-extension://kmendfapggjehodndflmmgagdbamhnfd/u2f-comms.html';
|
||||||
|
|
||||||
function extractFileURL(message) {
|
function extractFileURL(message) {
|
||||||
const matched = message.match(/Not allowed to load local resource:\s*(.+)/);
|
const matched = message.match(/Not allowed to load local resource:\s*(.+)/);
|
||||||
if (matched) {
|
if (matched) {
|
||||||
@@ -72,6 +75,11 @@ const MattermostView = createReactClass({
|
|||||||
if (e.errorCode === -3) { // An operation was aborted (due to user action).
|
if (e.errorCode === -3) { // An operation was aborted (due to user action).
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (e.errorCode === ERR_NOT_IMPLEMENTED && e.validatedURL === U2F_EXTENSION_URL) {
|
||||||
|
// U2F device is not supported, but the guest page should fall back to PIN code in 2FA.
|
||||||
|
// https://github.com/mattermost/desktop/issues/708
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
self.setState({
|
self.setState({
|
||||||
errorInfo: e,
|
errorInfo: e,
|
||||||
|
Reference in New Issue
Block a user