Merge branch 'master' into auto-updater
This commit is contained in:
commit
849800a80f
|
@ -23,6 +23,8 @@ Release date: TBD
|
|||
#### Windows
|
||||
- Set "app start on login" preference to default on and synchronize its state with config.json.
|
||||
[#846](https://github.com/mattermost/desktop/pull/846)
|
||||
- Removed the ability to open UNC path and file:// links.
|
||||
[#881](https://github.com/mattermost/desktop/pull/881)
|
||||
|
||||
#### Mac
|
||||
- Add **.dmg** package to support installation.
|
||||
|
@ -38,6 +40,8 @@ Release date: TBD
|
|||
[#818](https://github.com/mattermost/desktop/pull/818)
|
||||
- Set "app start on login" preference to default on and synchronize its state with config.json.
|
||||
[#846](https://github.com/mattermost/desktop/pull/846)
|
||||
- Added AppImage packages as unofficial build
|
||||
[#864](https://github.com/mattermost/desktop/pull/864)
|
||||
|
||||
### Architectural Changes
|
||||
- Major version upgrade of Electron to v2.0.8. Electron is the underlying technology used to build the Desktop apps.
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
"category": "Network;InstantMessaging",
|
||||
"target": [
|
||||
"deb",
|
||||
"tar.gz"
|
||||
"tar.gz",
|
||||
"appimage"
|
||||
],
|
||||
"extraFiles": [
|
||||
{
|
||||
|
|
|
@ -11,4 +11,5 @@ cp "${SRC}/mattermost-desktop-setup-${VERSION}-win.exe" "${DEST}/"
|
|||
cp "${SRC}"/mattermost-desktop-*.zip "${DEST}/"
|
||||
cp "${SRC}"/*.tar.gz "${DEST}/"
|
||||
cp "${SRC}"/*.deb "${DEST}/"
|
||||
cp "${SRC}"/*.AppImage "${DEST}/"
|
||||
cp "${SRC}"/*.yml "${DEST}/"
|
||||
|
|
|
@ -22,25 +22,6 @@ const preloadJS = `file://${remote.app.getAppPath()}/browser/webview/mattermost_
|
|||
const ERR_NOT_IMPLEMENTED = -11;
|
||||
const U2F_EXTENSION_URL = 'chrome-extension://kmendfapggjehodndflmmgagdbamhnfd/u2f-comms.html';
|
||||
|
||||
function extractFileURL(message) {
|
||||
const matched = message.match(/Not allowed to load local resource:\s*(.+)/);
|
||||
if (matched) {
|
||||
return matched[1];
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function isNetworkDrive(fileURL) {
|
||||
const u = url.parse(fileURL);
|
||||
if (u.protocol === 'file:' && u.host) {
|
||||
// Disallow localhost, 127.0.0.1, ::1.
|
||||
if (!u.host.match(/^localhost$|^127\.0\.0\.1$|^\[::1\]$/)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export default class MattermostView extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
@ -191,19 +172,9 @@ export default class MattermostView extends React.Component {
|
|||
case 1:
|
||||
console.warn(message);
|
||||
break;
|
||||
case 2: {
|
||||
const fileURL = extractFileURL(e.message);
|
||||
if (isNetworkDrive(fileURL)) {
|
||||
// Network drive: Should be allowed.
|
||||
if (!shell.openExternal(decodeURI(fileURL))) {
|
||||
console.log(`[${this.props.name}] shell.openExternal failed: ${fileURL}`);
|
||||
}
|
||||
} else {
|
||||
// Local drive such as 'C:\Windows': Should not be allowed.
|
||||
console.error(message);
|
||||
}
|
||||
case 2:
|
||||
console.error(message);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
console.log(message);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue