Compare commits

...

7 Commits

Author SHA1 Message Date
Electron Bot
56e81665fb Bump v11.0.0-beta.3 2020-08-31 08:01:05 -07:00
trop[bot]
e68f086d95 fix: do not reset process_id in URLLoaderFactoryParams (#25180)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-08-31 10:08:52 +09:00
trop[bot]
74edd99570 fix: save dialog extensions should be deterministic (#25193)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-08-28 11:38:07 -07:00
trop[bot]
63720fd603 fix: resolve RegisterSuspendResumeNotification dynamically (#25168)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-08-28 10:15:40 +09:00
Markus Olsson
d6bea2a681 fix: make shell.moveItemToTrash return false on Windows when move unsuccessful (#25171) 2020-08-27 17:43:52 -07:00
Electron Bot
5b53a08132 Bump v11.0.0-beta.2 2020-08-27 08:01:11 -07:00
Electron Bot
09e33b3420 Bump v11.0.0-beta.1 2020-08-26 10:51:08 -07:00
9 changed files with 65 additions and 18 deletions

View File

@@ -1 +1 @@
11.0.0-nightly.20200826
11.0.0-beta.3

View File

@@ -1,6 +1,6 @@
{
"name": "electron",
"version": "11.0.0-nightly.20200826",
"version": "11.0.0-beta.3",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {

View File

@@ -8,7 +8,6 @@
#include <wtsapi32.h>
#include "base/win/windows_types.h"
#include "base/win/windows_version.h"
#include "base/win/wrapped_window_proc.h"
#include "ui/base/win/shell.h"
#include "ui/gfx/win/hwnd_util.h"
@@ -44,7 +43,12 @@ void PowerMonitor::InitPlatformSpecificMonitors() {
// For Windows 8 and later, a new "connected standy" mode has been added and
// we must explicitly register for its notifications.
if (base::win::GetVersion() >= base::win::Version::WIN8) {
auto RegisterSuspendResumeNotification =
reinterpret_cast<decltype(&::RegisterSuspendResumeNotification)>(
GetProcAddress(GetModuleHandle(L"user32.dll"),
"RegisterSuspendResumeNotification"));
if (RegisterSuspendResumeNotification) {
RegisterSuspendResumeNotification(static_cast<HANDLE>(window_),
DEVICE_NOTIFY_WINDOW_HANDLE);
}

View File

@@ -1506,15 +1506,10 @@ void ElectronBrowserClient::OverrideURLLoaderFactoryParams(
const url::Origin& origin,
bool is_for_isolated_world,
network::mojom::URLLoaderFactoryParams* factory_params) {
for (const auto& iter : process_preferences_) {
if (iter.second.browser_context != browser_context)
continue;
if (!iter.second.web_security) {
// bypass CORB
factory_params->process_id = iter.first;
factory_params->is_corb_enabled = false;
}
// Bypass CORB when web security is disabled.
auto it = process_preferences_.find(factory_params->process_id);
if (it != process_preferences_.end() && !it->second.web_security) {
factory_params->is_corb_enabled = false;
}
extensions::URLLoaderFactoryManager::OverrideURLLoaderFactoryParams(

View File

@@ -50,8 +50,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 11,0,0,20200826
PRODUCTVERSION 11,0,0,20200826
FILEVERSION 11,0,0,3
PRODUCTVERSION 11,0,0,3
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L

View File

@@ -90,7 +90,8 @@ void SetAllowedFileTypes(NSSavePanel* dialog, const Filters& filters) {
// Create array to keep file types and their name.
for (const Filter& filter : filters) {
NSMutableSet* file_type_set = [NSMutableSet set];
NSMutableOrderedSet* file_type_set =
[NSMutableOrderedSet orderedSetWithCapacity:filters.size()];
[filter_names addObject:@(filter.first.c_str())];
for (std::string ext : filter.second) {
// macOS is incapable of understanding multiple file extensions,
@@ -104,7 +105,7 @@ void SetAllowedFileTypes(NSSavePanel* dialog, const Filters& filters) {
[file_type_set addObject:@(ext.c_str())];
}
[file_types_list addObject:[file_type_set allObjects]];
[file_types_list addObject:[file_type_set array]];
}
// Passing empty array to setAllowedFileTypes will cause exception.

View File

@@ -387,10 +387,14 @@ bool MoveItemToTrash(const base::FilePath& path, bool delete_on_fail) {
if (!delete_sink)
return false;
BOOL pfAnyOperationsAborted;
// Processes the queued command DeleteItem. This will trigger
// the DeleteFileProgressSink to check for Recycle Bin.
return SUCCEEDED(pfo->DeleteItem(delete_item.Get(), delete_sink.Get())) &&
SUCCEEDED(pfo->PerformOperations());
SUCCEEDED(pfo->PerformOperations()) &&
SUCCEEDED(pfo->GetAnyOperationsAborted(&pfAnyOperationsAborted)) &&
!pfAnyOperationsAborted;
}
bool GetFolderPath(int key, base::FilePath* result) {

View File

@@ -7,6 +7,8 @@ import * as fs from 'fs-extra';
import * as path from 'path';
import { AddressInfo } from 'net';
import { expect } from 'chai';
import { ifit } from './spec-helpers';
import { execSync } from 'child_process';
describe('shell module', () => {
describe('shell.openExternal()', () => {
@@ -76,5 +78,38 @@ describe('shell module', () => {
const result = shell.moveItemToTrash(filename);
expect(result).to.be.false();
});
ifit(process.platform === 'darwin')('returns false when file has immutable flag', async () => {
const dir = await fs.mkdtemp(path.resolve(app.getPath('temp'), 'electron-shell-spec-'));
const tempPath = path.join(dir, 'locked-file');
await fs.writeFile(tempPath, 'delete me if you can');
// https://ss64.com/osx/chflags.html
execSync(`chflags uchg ${tempPath}`);
expect(shell.moveItemToTrash(tempPath)).to.be.false();
expect(await fs.pathExists(tempPath)).to.be.true();
execSync(`chflags nouchg ${tempPath}`);
expect(shell.moveItemToTrash(tempPath)).to.be.true();
expect(await fs.pathExists(tempPath)).to.be.false();
});
ifit(process.platform === 'win32')('returns false when path is in use', async () => {
const tempPath = await fs.mkdtemp(path.resolve(app.getPath('temp'), 'electron-shell-spec-'));
const cwd = process.cwd();
try {
// A process working directory is automatically locked on Windows.
// This is a workaround to avoid pulling in fs-extras flock method.
process.chdir(tempPath);
expect(shell.moveItemToTrash(tempPath)).to.be.false();
expect(await fs.pathExists(tempPath)).to.be.true();
} finally {
process.chdir(cwd);
}
expect(shell.moveItemToTrash(tempPath)).to.be.true();
expect(await fs.pathExists(tempPath)).to.be.false();
});
});
});

View File

@@ -245,6 +245,14 @@ describe('web security', () => {
<script src="${serverUrl}"></script>`);
await p;
});
it('does not crash when multiple WebContent are created with web security disabled', () => {
const options = { webPreferences: { webSecurity: false } };
const w1 = new BrowserWindow(options);
w1.loadURL(serverUrl);
const w2 = new BrowserWindow(options);
w2.loadURL(serverUrl);
});
});
describe('command line switches', () => {