Compare commits

...

83 Commits

Author SHA1 Message Date
John Kleinschmidt
5a44e7c058 Bump for missing builds 2017-10-11 12:27:12 -04:00
John Kleinschmidt
bee5a70fbf Bump v1.6.15 2017-10-11 11:28:58 -04:00
John Kleinschmidt
73c4fe626b Merge pull request #10756 from electron/1-6-crankshaft-fix
Crankshaft RCE fix
2017-10-11 11:12:23 -04:00
John Kleinschmidt
befa1d9c79 Crankshaft RCE fix 2017-10-11 10:45:36 -04:00
John Kleinschmidt
40e37c68d5 Add publish-to-npm script 2017-09-28 09:20:28 -04:00
John Kleinschmidt
0c37f633b8 Remove arm64 references from prerelease check 2017-09-28 09:20:17 -04:00
John Kleinschmidt
1723c302f7 Bump for release build 2017-09-27 19:00:58 -04:00
John Kleinschmidt
f41051fe60 Merge branch 'release-1-6' of https://github.com/electron/electron into release-1-6 2017-09-27 18:55:18 -04:00
John Kleinschmidt
396a49e349 Bump for building with larger machines 2017-09-27 18:54:23 -04:00
John Kleinschmidt
482a1d2e2b Bump to add release logic to CircleCI 2017-09-27 18:50:30 -04:00
John Kleinschmidt
ca6127c802 Bump to properly set ELECTRON_RELEASE 2017-09-27 18:35:50 -04:00
John Kleinschmidt
588f906fba Bump to fix bootstrap call 2017-09-27 18:35:49 -04:00
John Kleinschmidt
14bdbbcc10 Bump to fix circleci indentation 2017-09-27 18:35:49 -04:00
John Kleinschmidt
a0cec63c91 Bump for circleCI config update 2017-09-27 18:35:49 -04:00
John Kleinschmidt
233fdeaef0 Bump to add release logic to CircleCI 2017-09-27 18:35:49 -04:00
John Kleinschmidt
54b12ba15d Bump to add prerelease check 2017-09-27 18:35:49 -04:00
John Kleinschmidt
cfa4fbc9c1 Change GitHub upload to use JS GitHub lib 2017-09-27 18:35:49 -04:00
John Kleinschmidt
4b03f5b87e Bump v1.6.14 2017-09-27 18:35:49 -04:00
John Kleinschmidt
acf6518317 Bump for building with larger machines 2017-09-27 17:44:32 -04:00
John Kleinschmidt
f7e07205b4 Bump to properly set ELECTRON_RELEASE 2017-09-27 15:59:45 -04:00
John Kleinschmidt
248c1e1118 Bump to fix bootstrap call 2017-09-27 15:37:49 -04:00
John Kleinschmidt
cb251892c2 Bump to fix circleci indentation 2017-09-27 15:30:59 -04:00
John Kleinschmidt
5fcf20a7aa Bump for circleCI config update 2017-09-27 15:27:27 -04:00
John Kleinschmidt
2e38f9ca1c Bump to add release logic to CircleCI 2017-09-27 14:42:09 -04:00
Birunthan Mohanathas
ece433f766 Merge pull request #10631 from electron/squirrel-avoid-double-update-1-6
Use Squirrel.Windows --checkForUpdate (1.6.x)
2017-09-27 21:20:30 +03:00
J.M
f6005ce28d Use Squirrel.Windows --checkForUpdate
This cherry-picks #10483 to fix #5057.
2017-09-27 20:35:08 +03:00
John Kleinschmidt
93cea48d04 Bump to add prerelease check 2017-09-27 11:27:36 -04:00
John Kleinschmidt
4fb6bef8ed Bump for release build 2017-09-24 14:41:19 +09:00
John Kleinschmidt
f4fd62db47 Change GitHub upload to use JS GitHub lib 2017-09-24 14:40:37 +09:00
John Kleinschmidt
2ede7d9ec9 Bump v1.6.14 2017-09-24 14:14:03 +09:00
John Kleinschmidt
7a67c36cdb Disable flaky cert tests 2017-09-24 10:09:46 +09:00
John Kleinschmidt
1131b5ae2f Merge pull request #10587 from electron/turbofan-fix
Apply turbofan-fix
2017-09-23 18:14:50 +09:00
John Kleinschmidt
9429eea12c Apply turbofan-fix 2017-09-23 16:54:55 +09:00
John Kleinschmidt
a0b04005a9 Fix CircleCI test step 2017-09-13 11:24:53 -04:00
John Kleinschmidt
a7d3cea6e8 Add CircleCI config 2017-09-13 10:36:20 -04:00
John Kleinschmidt
f2fe287b34 Bump v1.6.13 2017-09-06 13:17:43 -04:00
John Kleinschmidt
47242064ba Fix syntax error 2017-09-06 12:54:26 -04:00
John Kleinschmidt
da73284515 Make sure future 1.6 releases are tagged correctly 2017-09-06 12:30:47 -04:00
John Kleinschmidt
9b74f25770 Backport macOS IME backspace fix for 1.6.x (#10450) 2017-09-06 11:25:14 -04:00
Zeke Sikelianos
dcb5a34922 Bump empty commit 2017-08-03 13:31:21 -07:00
Zeke Sikelianos
df55c1e717 Bump a third time 2017-08-03 10:43:29 -07:00
Zeke Sikelianos
a62f13856b Bump v1.6.12 2017-08-03 10:38:07 -07:00
Zeke Sikelianos
c83ff61fdf lock typescript generator to older version 2017-08-03 10:37:45 -07:00
John Kleinschmidt
2b83512c44 Merge pull request #10166 from electron/1-6-fixes
Backport fixes to 1.6
2017-08-02 16:58:14 -04:00
John Kleinschmidt
c12f7d3132 Fix commitText invocation 2017-08-02 09:45:42 -04:00
Zeke Sikelianos
9c0a8ab168 point to newer 1-6-fixes commit 2017-08-01 15:57:24 -07:00
Zeke Sikelianos
8842b04567 Merge pull request #10164 from electron/backport-10070-1-6-x
Backport 10070 to 1.6
2017-08-01 10:10:18 -07:00
Zeke Sikelianos
0573919fd3 use latest commit from libcc electron-1-6-x branch 2017-07-31 16:01:36 -07:00
Cheng Zhao
5253c0a816 Leak the Node environment when context is released 2017-07-31 13:23:35 -07:00
John Kleinschmidt
05b412313d Backport 10070 to 1.6 2017-07-31 10:20:49 -04:00
Kevin Sawicki
0428632a4e Bump v1.6.11 2017-05-25 10:56:30 -07:00
Kevin Sawicki
855d2c4b20 Merge pull request #9586 from electron/upgrade-libcc
Upgrade libcc with 1.6.x fixes
2017-05-25 10:55:25 -07:00
Kevin Sawicki
f0402be869 Enable verbose bootstrap on CI 2017-05-25 10:25:51 -07:00
Kevin Sawicki
5a1e3fc0f3 Upgrade to electron/libchromiumcontent@e2ec6935 2017-05-25 09:51:16 -07:00
Kevin Sawicki
01c31ee924 Merge pull request #9564 from rreimann/pdf-plugins-preference-backport
Backport suppress dispatching to PDF viewer if plugins are disabled to 1.6.x
2017-05-24 09:04:33 -07:00
rreimann
c29316b568 Remove superfluous method 2017-05-24 07:09:51 +02:00
Kevin Sawicki
21f15fa87e Delete mock.pdf after download completes
(cherry picked from commit 647e88da5a)
2017-05-23 14:22:26 +02:00
rreimann
ab95ecda42 Fix naming and formatting
(cherry picked from commit 25015c4c63)
2017-05-23 14:22:08 +02:00
rreimann
456e83f286 Extract common code into IsPreferenceEnabled method
(cherry picked from commit 791486433d)
2017-05-23 14:21:53 +02:00
rreimann
1612ebc539 Move preferences check to OnPdfResourceIntercepted
(cherry picked from commit 65da983ccb)
2017-05-23 14:21:35 +02:00
rreimann
1ddb8a8bf1 Add new test and enable plugins for existing tests
(cherry picked from commit 13665090d5)
2017-05-23 14:21:09 +02:00
rreimann
bbcdbc2e7c Fix linting violations
(cherry picked from commit 7982754958)
2017-05-23 14:20:41 +02:00
rreimann
d94bbd1573 Suppress pdf plugin dispatch if plugins are disabled
(cherry picked from commit 1b75e45a62)
2017-05-23 14:20:00 +02:00
Kevin Sawicki
583e14efcd Merge pull request #9514 from electron/disable-crash-specs-on-linux
Backport disabling crash specs on linux to 1.6
2017-05-17 15:25:14 -07:00
Kevin Sawicki
b96803e3a0 Disable crashReporter specs on Linux CI 2017-05-17 15:00:39 -07:00
Kevin Sawicki
c03cb11aaf Merge pull request #9505 from electron/backport-sandbox-remote-exception-fix
Backport sandbox remote exception fix
2017-05-17 11:19:25 -07:00
Kevin Sawicki
5de881e668 Merge pull request #9499 from electron/node-cert-patch
Upgrade node for StartCom/WoSign cert rejection
2017-05-17 11:07:21 -07:00
Thiago de Arruda
964505398d Add test for #9387 2017-05-17 07:29:22 -03:00
Thiago de Arruda
16f2958ad7 Fix how rpc-server releases references after page reload
In addition to listening for "render-view-deleted", listen for
"ELECTRON_BROWSER_CONTEXT_RELEASE" synchronous message, which is sent by the
remote module when the page is about to be navigated.

This is required to allow child windows running in the same renderer to
correctly manage remote object references, since `render-view-deleted` is only
called when the renderer exits.

Close #9387
2017-05-17 07:29:06 -03:00
Kevin Sawicki
332b92ebab Upgrade node for StartCom/WoSign cert rejection 2017-05-16 16:29:43 -07:00
Kevin Sawicki
b9f66a342c Bump v1.6.10 2017-05-16 10:38:35 -07:00
Kevin Sawicki
23ce796450 Merge pull request #9484 from electron/1-6-x-typescript-backport
backport electron.d.ts fixes 1.6
2017-05-16 10:15:29 -07:00
Samuel Attard
df6d316dc2 Fix webcontents capital 2017-05-15 15:16:22 -07:00
Kevin Sawicki
82a93ce645 Correct property name to pid 2017-05-15 14:19:02 -07:00
Kevin Sawicki
5ceaca66f5 fix setAutoResize options 2017-05-15 14:18:44 -07:00
Kevin Sawicki
4c0e35776b fix setAutoResize options 2017-05-15 14:18:02 -07:00
Birunthan Mohanathas
cc1f213d84 bump versions of electron-docs-linter and electron-typescript-definitions 2017-05-15 14:04:22 -07:00
Birunthan Mohanathas
4c18037e6a Fix copy paste typos in BrowserView docs 2017-05-15 14:02:05 -07:00
Samuel Attard
7f0ccdadcd Fix createFromDataURL return type
Fixes #9469
2017-05-15 14:02:00 -07:00
Birunthan Mohanathas
8ac9499b45 Make docs for webview.findInPage and webContents.findInPage consistent 2017-05-15 14:01:55 -07:00
Birunthan Mohanathas
8094d68acc Fix postData type definition in docs 2017-05-15 14:01:50 -07:00
Samuel Attard
80066c22b2 Fix return type of makeSingleInstance 2017-05-15 14:01:45 -07:00
Zeke Sikelianos
8f78f3b253 add npm scripts for convenience 2017-05-15 14:01:34 -07:00
42 changed files with 832 additions and 70 deletions

200
.circleci/config.yml Normal file
View File

@@ -0,0 +1,200 @@
version: 2
jobs:
electron-linux-arm:
docker:
- image: electronbuilds/electron:0.0.3
environment:
TARGET_ARCH: arm
resource_class: xlarge
steps:
- checkout
- run: sh -e /etc/init.d/xvfb start
- run:
name: Check for release
command: |
MESSAGE="$(git log --format=%B -n 1 HEAD)"
case ${MESSAGE} in
Bump* ) echo 'export ELECTRON_RELEASE=1' >> $BASH_ENV
esac
- run:
name: Bootstrap
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Bootstrapping Electron for release build'
script/bootstrap.py --target_arch=$TARGET_ARCH -v
else
echo 'Bootstrapping Electron for debug build'
script/bootstrap.py --target_arch=$TARGET_ARCH -v --dev
fi
- run: npm run lint
- run:
name: Build
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Building Electron for release'
script/build.py -c R
else
echo 'Building Electron for debug'
script/build.py -c D
fi
- run:
name: Create distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Creating Electron release distribution'
script/create-dist.py
else
echo 'Skipping create distribution because build is not for release'
fi
- run:
name: Upload distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Uploading Electron release distribution'
script/upload.py
else
echo 'Skipping upload distribution because build is not for release'
fi
electron-linux-ia32:
docker:
- image: electronbuilds/electron:0.0.3
environment:
TARGET_ARCH: ia32
resource_class: xlarge
steps:
- checkout
- run: sh -e /etc/init.d/xvfb start
- run:
name: Check for release
command: |
MESSAGE="$(git log --format=%B -n 1 HEAD)"
case ${MESSAGE} in
Bump* ) echo 'export ELECTRON_RELEASE=1' >> $BASH_ENV
esac
- run:
name: Bootstrap
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Bootstrapping Electron for release build'
script/bootstrap.py --target_arch=$TARGET_ARCH -v
else
echo 'Bootstrapping Electron for debug build'
script/bootstrap.py --target_arch=$TARGET_ARCH -v --dev
fi
- run: npm run lint
- run:
name: Build
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Building Electron for release'
script/build.py -c R
else
echo 'Building Electron for debug'
script/build.py -c D
fi
- run:
name: Create distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Creating Electron release distribution'
script/create-dist.py
else
echo 'Skipping create distribution because build is not for release'
fi
- run:
name: Upload distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Uploading Electron release distribution'
script/upload.py
else
echo 'Skipping upload distribution because build is not for release'
fi
electron-linux-x64:
docker:
- image: electronbuilds/electron:0.0.3
environment:
TARGET_ARCH: x64
resource_class: xlarge
steps:
- checkout
- run: sh -e /etc/init.d/xvfb start
- run:
name: Check for release
command: |
MESSAGE="$(git log --format=%B -n 1 HEAD)"
case ${MESSAGE} in
Bump* ) echo 'export ELECTRON_RELEASE=1' >> $BASH_ENV
esac
- run:
name: Bootstrap
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Bootstrapping Electron for release build'
script/bootstrap.py --target_arch=$TARGET_ARCH -v
else
echo 'Bootstrapping Electron for debug build'
script/bootstrap.py --target_arch=$TARGET_ARCH -v --dev
fi
- run: npm run lint
- run:
name: Build
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Building Electron for release'
script/build.py -c R
else
echo 'Building Electron for debug'
script/build.py -c D
fi
- run:
name: Create distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Creating Electron release distribution'
script/create-dist.py
else
echo 'Skipping create distribution because build is not for release'
fi
- run:
name: Upload distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Uploading Electron release distribution'
script/upload.py
else
echo 'Skipping upload distribution because build is not for release'
fi
- run:
name: Test
command: |
if [ "$ELECTRON_RELEASE" != "1" ]; then
echo 'Testing Electron debug build'
script/test.py --ci
else
echo 'Skipping testing on release build'
fi
- run:
name: Verify FFmpeg
command: |
if [ "$ELECTRON_RELEASE" != "1" ]; then
echo 'Verifying ffmpeg on debug build'
script/verify-ffmpeg.py
else
echo 'Skipping verify ffmpeg on release build'
fi
workflows:
version: 2
build-arm:
jobs:
- electron-linux-arm
build-ia32:
jobs:
- electron-linux-ia32
build-x64:
jobs:
- electron-linux-x64

View File

@@ -4,13 +4,16 @@
#include "atom/browser/atom_resource_dispatcher_host_delegate.h"
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/login_handler.h"
#include "atom/browser/web_contents_permission_helper.h"
#include "atom/browser/web_contents_preferences.h"
#include "atom/common/atom_constants.h"
#include "atom/common/platform_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/stream_info.h"
#include "net/base/escape.h"
#include "net/ssl/client_cert_store.h"
@@ -69,6 +72,17 @@ void OnPdfResourceIntercepted(
if (!web_contents)
return;
if (!WebContentsPreferences::IsPluginsEnabled(web_contents)) {
auto browser_context = web_contents->GetBrowserContext();
auto download_manager =
content::BrowserContext::GetDownloadManager(browser_context);
download_manager->DownloadUrl(
content::DownloadUrlParameters::CreateForWebContentsMainFrame(
web_contents, original_url));
return;
}
// The URL passes the original pdf resource url, that will be requested
// by the webui page.
// chrome://pdf-viewer/index.html?src=https://somepage/123.pdf

View File

@@ -17,9 +17,9 @@
<key>CFBundleIconFile</key>
<string>electron.icns</string>
<key>CFBundleVersion</key>
<string>1.6.9</string>
<string>1.6.15</string>
<key>CFBundleShortVersionString</key>
<string>1.6.9</string>
<string>1.6.15</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>

View File

@@ -56,8 +56,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,6,9,0
PRODUCTVERSION 1,6,9,0
FILEVERSION 1,6,15,0
PRODUCTVERSION 1,6,15,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -74,12 +74,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "GitHub, Inc."
VALUE "FileDescription", "Electron"
VALUE "FileVersion", "1.6.9"
VALUE "FileVersion", "1.6.15"
VALUE "InternalName", "electron.exe"
VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved."
VALUE "OriginalFilename", "electron.exe"
VALUE "ProductName", "Electron"
VALUE "ProductVersion", "1.6.9"
VALUE "ProductVersion", "1.6.15"
VALUE "SquirrelAwareVersion", "1"
END
END

View File

@@ -163,6 +163,18 @@ void SetMenuItemID(DbusmenuMenuitem* item, int id) {
g_object_set_data(G_OBJECT(item), "menu-id", GINT_TO_POINTER(id + 1));
}
std::string GetMenuModelStatus(AtomMenuModel* model) {
std::string ret;
for (int i = 0; i < model->GetItemCount(); ++i) {
int status = model->GetTypeAt(i) | (model->IsVisibleAt(i) << 3)
| (model->IsEnabledAt(i) << 4)
| (model->IsItemCheckedAt(i) << 5);
ret += base::StringPrintf(
"%s-%X\n", base::UTF16ToUTF8(model->GetLabelAt(i)).c_str(), status);
}
return ret;
}
} // namespace
GlobalMenuBarX11::GlobalMenuBarX11(NativeWindowViews* window)
@@ -307,6 +319,16 @@ void GlobalMenuBarX11::OnSubMenuShow(DbusmenuMenuitem* item) {
if (!model || !GetMenuItemID(item, &id))
return;
// Do not update menu if the submenu has not been changed.
std::string status = GetMenuModelStatus(model);
char* old = static_cast<char*>(g_object_get_data(G_OBJECT(item), "status"));
if (old && status == old)
return;
// Save the new status.
g_object_set_data_full(G_OBJECT(item), "status", g_strdup(status.c_str()),
g_free);
// Clear children.
GList *children = menuitem_take_children(item);
g_list_foreach(children, reinterpret_cast<GFunc>(g_object_unref), NULL);

View File

@@ -197,7 +197,9 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches(
}
}
bool WebContentsPreferences::IsSandboxed(content::WebContents* web_contents) {
bool WebContentsPreferences::IsPreferenceEnabled(
const std::string& attribute_name,
content::WebContents* web_contents) {
WebContentsPreferences* self;
if (!web_contents)
return false;
@@ -207,9 +209,18 @@ bool WebContentsPreferences::IsSandboxed(content::WebContents* web_contents) {
return false;
base::DictionaryValue& web_preferences = self->web_preferences_;
bool sandboxed = false;
web_preferences.GetBoolean("sandbox", &sandboxed);
return sandboxed;
bool bool_value = false;
web_preferences.GetBoolean(attribute_name, &bool_value);
return bool_value;
}
bool WebContentsPreferences::IsSandboxed(content::WebContents* web_contents) {
return IsPreferenceEnabled("sandbox", web_contents);
}
bool WebContentsPreferences::IsPluginsEnabled(
content::WebContents* web_contents) {
return IsPreferenceEnabled("plugins", web_contents);
}
// static

View File

@@ -37,7 +37,10 @@ class WebContentsPreferences
static void AppendExtraCommandLineSwitches(
content::WebContents* web_contents, base::CommandLine* command_line);
static bool IsPreferenceEnabled(const std::string& attribute_name,
content::WebContents* web_contents);
static bool IsSandboxed(content::WebContents* web_contents);
static bool IsPluginsEnabled(content::WebContents* web_contents);
// Modify the WebPreferences according to |web_contents|'s preferences.
static void OverrideWebkitPrefs(

View File

@@ -7,7 +7,7 @@
#define ATOM_MAJOR_VERSION 1
#define ATOM_MINOR_VERSION 6
#define ATOM_PATCH_VERSION 9
#define ATOM_PATCH_VERSION 15
#define ATOM_VERSION_IS_RELEASE 1

View File

@@ -200,7 +200,10 @@ void WebFrame::RegisterURLSchemeAsPrivileged(const std::string& scheme,
void WebFrame::InsertText(const std::string& text) {
web_frame_->frameWidget()
->getActiveWebInputMethodController()
->commitText(blink::WebString::fromUTF8(text), 0);
->commitText(blink::WebString::fromUTF8(text),
blink::WebVector<blink::WebCompositionUnderline>(),
blink::WebRange(),
0);
}
void WebFrame::InsertCSS(const std::string& css) {

View File

@@ -135,7 +135,12 @@ void AtomRendererClient::WillReleaseScriptContext(
node_bindings_->set_uv_env(nullptr);
// Destroy the node environment.
node::FreeEnvironment(env);
// This is disabled because pending async tasks may still use the environment
// and would cause crashes later. Node does not seem to clear all async tasks
// when the environment is destroyed.
// node::FreeEnvironment(env);
// AtomBindings is tracking node environments.
atom_bindings_->EnvironmentDestroyed(env);
}

View File

@@ -667,6 +667,8 @@ app.setJumpList([
* `argv` String[] - An array of the second instance's command line arguments
* `workingDirectory` String - The second instance's working directory
Returns `Boolean`.
This method makes your application a Single Instance Application - instead of
allowing multiple instances of your app to run, this will ensure that only a
single instance of your app is running, and other instances signal this

View File

@@ -44,31 +44,31 @@ Objects created with `new BrowserView` have the following properties:
#### `view.webContents` _Experimental_
A [`webContents`](web-contents.md) object owned by this view.
A [`WebContents`](web-contents.md) object owned by this view.
#### `win.id` _Experimental_
#### `view.id` _Experimental_
A `Integer` representing the unique ID of the view.
### Instance Methods
Objects created with `new BrowserWindow` have the following instance methods:
Objects created with `new BrowserView` have the following instance methods:
#### `win.setAutoResize(options)` _Experimental_
#### `view.setAutoResize(options)` _Experimental_
* `options` Object
* `width`: If `true`, the view's width will grow and shrink together with
the window. `false` by default.
* `height`: If `true`, the view's height will grow and shrink together with
the window. `false` by default.
* `width` Boolean - If `true`, the view's width will grow and shrink together
with the window. `false` by default.
* `height` Boolean - If `true`, the view's height will grow and shrink
together with the window. `false` by default.
#### `win.setBounds(bounds)` _Experimental_
#### `view.setBounds(bounds)` _Experimental_
* `bounds` [Rectangle](structures/rectangle.md)
Resizes and moves the view to the supplied bounds relative to the window.
#### `win.setBackgroundColor(color)` _Experimental_
#### `view.setBackgroundColor(color)` _Experimental_
* `color` String - Color in `#aarrggbb` or `#argb` form. The alpha channel is
optional.

View File

@@ -1027,7 +1027,7 @@ Same as `webContents.capturePage([rect, ]callback)`.
* `httpReferrer` String (optional) - A HTTP Referrer url.
* `userAgent` String (optional) - A user agent originating the request.
* `extraHeaders` String (optional) - Extra headers separated by "\n"
* `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md) | [UploadFileSystem](structures/upload-file-system.md) | [UploadBlob](structures/upload-blob.md))[] - (optional)
* `postData` ([UploadRawData[]](structures/upload-raw-data.md) | [UploadFile[]](structures/upload-file.md) | [UploadFileSystem[]](structures/upload-file-system.md) | [UploadBlob[]](structures/upload-blob.md)) - (optional)
* `baseURLForDataURL` String (optional) - Base url (with trailing path separator) for files to be loaded by the data url. This is needed only if the specified `url` is a data url and needs to load other files.
Same as `webContents.loadURL(url[, options])`.

View File

@@ -153,6 +153,8 @@ Creates a new `NativeImage` instance from `buffer`.
* `dataURL` String
Returns `NativeImage`
Creates a new `NativeImage` instance from `dataURL`.
## Class: NativeImage

View File

@@ -1,6 +1,6 @@
# MemoryInfo Object
* `workingSetSize` Integer - Process id of the process.
* `pid` Integer - Process id of the process.
* `workingSetSize` Integer - The amount of memory currently pinned to actual physical RAM.
* `peakWorkingSetSize` Integer - The maximum amount of memory that has ever been pinned
to actual physical RAM.
@@ -9,4 +9,4 @@
* `sharedBytes` Integer - The amount of memory shared between processes, typically
memory consumed by the Electron code itself
Note that all statistics are reported in Kilobytes.
Note that all statistics are reported in Kilobytes.

View File

@@ -537,7 +537,7 @@ that can't be set via `<webview>` attributes.
* `httpReferrer` String (optional) - A HTTP Referrer url.
* `userAgent` String (optional) - A user agent originating the request.
* `extraHeaders` String (optional) - Extra headers separated by "\n"
* `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md) | [UploadFileSystem](structures/upload-file-system.md) | [UploadBlob](structures/upload-blob.md))[] - (optional)
* `postData` ([UploadRawData[]](structures/upload-raw-data.md) | [UploadFile[]](structures/upload-file.md) | [UploadFileSystem[]](structures/upload-file-system.md) | [UploadBlob[]](structures/upload-blob.md)) - (optional)
* `baseURLForDataURL` String (optional) - Base url (with trailing path separator) for files to be loaded by the data url. This is needed only if the specified `url` is a data url and needs to load other files.
Loads the `url` in the window. The `url` must contain the protocol prefix,

View File

@@ -312,8 +312,8 @@ webview.addEventListener('dom-ready', () => {
* `httpReferrer` String (optional) - A HTTP Referrer url.
* `userAgent` String (optional) - A user agent originating the request.
* `extraHeaders` String (optional) - Extra headers separated by "\n"
* `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md) | [UploadFileSystem](structures/upload-file-system.md) | [UploadBlob](structures/upload-blob.md))[] - (optional)
* `baseURLForDataURL` String (optional) - Base url (with trailing path separator) for files to be loaded by the data url. This is needed only if the specified `url` is a data url and needs to load other files.
* `postData` ([UploadRawData[]](structures/upload-raw-data.md) | [UploadFile[]](structures/upload-file.md) | [UploadFileSystem[]](structures/upload-file-system.md) | [UploadBlob[]](structures/upload-blob.md)) - (optional)
* `baseURLForDataURL` String (optional) - Base url (with trailing path separator) for files to be loaded by the data url. This is needed only if the specified `url` is a data url and needs to load other files.
Loads the `url` in the webview, the `url` must contain the protocol prefix,
e.g. the `http://` or `file://`.
@@ -511,14 +511,14 @@ Inserts `text` to the focused element.
* `text` String - Content to be searched, must not be empty.
* `options` Object (optional)
* `forward` Boolean - Whether to search forward or backward, defaults to `true`.
* `findNext` Boolean - Whether the operation is first request or a follow up,
* `forward` Boolean - (optional) Whether to search forward or backward, defaults to `true`.
* `findNext` Boolean - (optional) Whether the operation is first request or a follow up,
defaults to `false`.
* `matchCase` Boolean - Whether search should be case-sensitive,
* `matchCase` Boolean - (optional) Whether search should be case-sensitive,
defaults to `false`.
* `wordStart` Boolean - Whether to look only at the start of words.
* `wordStart` Boolean - (optional) Whether to look only at the start of words.
defaults to `false`.
* `medialCapitalAsWordStart` Boolean - When combined with `wordStart`,
* `medialCapitalAsWordStart` Boolean - (optional) When combined with `wordStart`,
accepts a match in the middle of a word if the match begins with an
uppercase letter followed by a lowercase or non-letter.
Accepts several other intra-word matches, defaults to `false`.

View File

@@ -4,7 +4,7 @@
'product_name%': 'Electron',
'company_name%': 'GitHub, Inc',
'company_abbr%': 'github',
'version%': '1.6.9',
'version%': '1.6.15',
'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c',
},
'includes': [

View File

@@ -29,7 +29,7 @@ class AutoUpdater extends EventEmitter {
return this.emitError('Can not find Squirrel')
}
this.emit('checking-for-update')
squirrelUpdate.download(this.updateURL, (error, update) => {
squirrelUpdate.checkForUpdate(this.updateURL, (error, update) => {
if (error != null) {
return this.emitError(error)
}

View File

@@ -82,8 +82,8 @@ exports.processStart = function () {
}
// Download the releases specified by the URL and write new results to stdout.
exports.download = function (updateURL, callback) {
return spawnUpdate(['--download', updateURL], false, function (error, stdout) {
exports.checkForUpdate = function (updateURL, callback) {
return spawnUpdate(['--checkForUpdate', updateURL], false, function (error, stdout) {
var json, ref, ref1, update
if (error != null) {
return callback(error)

View File

@@ -394,6 +394,11 @@ ipcMain.on('ELECTRON_BROWSER_DEREFERENCE', function (event, id) {
objectsRegistry.remove(event.sender.getId(), id)
})
ipcMain.on('ELECTRON_BROWSER_CONTEXT_RELEASE', (e) => {
objectsRegistry.clear(e.sender.getId())
e.returnValue = null
})
ipcMain.on('ELECTRON_BROWSER_GUEST_WEB_CONTENTS', function (event, guestInstanceId) {
try {
let guestViewManager = require('./guest-view-manager')

View File

@@ -304,6 +304,10 @@ ipcRenderer.on('ELECTRON_RENDERER_RELEASE_CALLBACK', function (event, id) {
callbacksRegistry.remove(id)
})
process.on('exit', () => {
ipcRenderer.sendSync('ELECTRON_BROWSER_CONTEXT_RELEASE')
})
// Get remote module.
exports.require = function (module) {
return metaToValue(ipcRenderer.sendSync('ELECTRON_BROWSER_REQUIRE', module))

10
npm/cli.js Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env node
var electron = require('./')
var proc = require('child_process')
var child = proc.spawn(electron, process.argv.slice(2), {stdio: 'inherit'})
child.on('close', function (code) {
process.exit(code)
})

10
npm/index.js Normal file
View File

@@ -0,0 +1,10 @@
var fs = require('fs')
var path = require('path')
var pathFile = path.join(__dirname, 'path.txt')
if (fs.existsSync(pathFile)) {
module.exports = path.join(__dirname, fs.readFileSync(pathFile, 'utf-8'))
} else {
throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
}

65
npm/install.js Executable file
View File

@@ -0,0 +1,65 @@
#!/usr/bin/env node
// maintainer note - x.y.z-ab version in package.json -> x.y.z
var version = require('./package').version.replace(/-.*/, '')
var fs = require('fs')
var os = require('os')
var path = require('path')
var extract = require('extract-zip')
var download = require('electron-download')
var installedVersion = null
try {
installedVersion = fs.readFileSync(path.join(__dirname, 'dist', 'version'), 'utf-8').replace(/^v/, '')
} catch (ignored) {
// do nothing
}
var platformPath = getPlatformPath()
if (installedVersion === version && fs.existsSync(path.join(__dirname, platformPath))) {
process.exit(0)
}
// downloads if not cached
download({
cache: process.env.electron_config_cache,
version: version,
platform: process.env.npm_config_platform,
arch: process.env.npm_config_arch,
strictSSL: process.env.npm_config_strict_ssl === 'true',
force: process.env.force_no_cache === 'true',
quiet: ['info', 'verbose', 'silly', 'http'].indexOf(process.env.npm_config_loglevel) === -1
}, extractFile)
// unzips and makes path.txt point at the correct executable
function extractFile (err, zipPath) {
if (err) return onerror(err)
extract(zipPath, {dir: path.join(__dirname, 'dist')}, function (err) {
if (err) return onerror(err)
fs.writeFile(path.join(__dirname, 'path.txt'), platformPath, function (err) {
if (err) return onerror(err)
})
})
}
function onerror (err) {
throw err
}
function getPlatformPath () {
var platform = process.env.npm_config_platform || os.platform()
switch (platform) {
case 'darwin':
return 'dist/Electron.app/Contents/MacOS/Electron'
case 'freebsd':
case 'linux':
return 'dist/electron'
case 'win32':
return 'dist/electron.exe'
default:
throw new Error('Electron builds are not available on platform: ' + platform)
}
}

26
npm/package.json Normal file
View File

@@ -0,0 +1,26 @@
{
"scripts": {
"cache-clean": "rm -rf ~/.electron && rm -rf dist",
"postinstall": "node install.js",
"pretest": "npm run cache-clean",
"test": "standard"
},
"bin": {
"electron": "cli.js"
},
"main": "index.js",
"types": "electron.d.ts",
"dependencies": {
"@types/node": "^7.0.18",
"electron-download": "^3.0.1",
"extract-zip": "^1.0.3"
},
"devDependencies": {
"home-path": "^0.1.1",
"path-exists": "^2.0.0",
"standard": "^5.4.1"
},
"directories": {
"test": "test"
}
}

View File

@@ -1,12 +1,15 @@
{
"name": "electron",
"version": "1.6.9",
"version": "1.6.15",
"devDependencies": {
"asar": "^0.11.0",
"browserify": "^13.1.0",
"colors": "^1.1.2",
"electabul": "~0.0.4",
"electron-docs-linter": "^2.1.0",
"electron-typescript-definitions": "^1.2.0",
"electron-docs-linter": "^2.3.3",
"electron-typescript-definitions": "1.2.7",
"github": "^9.2.0",
"heads": "^1.3.0",
"request": "*",
"standard": "^8.4.0",
"standard-markdown": "^2.1.1"
@@ -40,7 +43,10 @@
"lint-py": "python ./script/pylint.py",
"lint-api-docs-js": "standard-markdown docs && standard-markdown docs-translations",
"lint-api-docs": "electron-docs-linter",
"create-api-json": "electron-docs-linter docs --outfile=out/electron-api.json --version=$npm_package_version",
"create-typescript-definitions": "npm run create-api-json && electron-typescript-definitions --in=out/electron-api.json --out=out/electron.d.ts",
"preinstall": "node -e 'process.exit(0)'",
"prerelease": "node ./script/prerelease",
"release": "./script/upload.py -p",
"repl": "python ./script/start.py --interactive",
"start": "python ./script/start.py",

View File

@@ -55,10 +55,9 @@ def main():
deps += LINUX_DEPS_ARM
execute(['sudo', 'apt-get', 'install'] + deps)
execute(['sh', '-e', '/etc/init.d/xvfb', 'start'])
if PLATFORM == 'linux':
if PLATFORM == 'linux' and target_arch == 'x64':
os.environ['DISPLAY'] = ':99.0'
execute(['sh', '-e', '/etc/init.d/xvfb', 'start'])
# CI's npm is not reliable.
npm = 'npm.cmd' if PLATFORM == 'win32' else 'npm'
@@ -72,7 +71,7 @@ def main():
os.environ.get('PATH', '')])
is_release = os.environ.has_key('ELECTRON_RELEASE')
args = ['--target_arch=' + target_arch]
args = ['--target_arch=' + target_arch, '-v']
if not is_release:
args += ['--dev']
run_script('bootstrap.py', args)

View File

@@ -9,7 +9,7 @@ import sys
BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = os.getenv('LIBCHROMIUMCONTENT_COMMIT') or \
'4a0e32606e52c12c50c2e3a0973d015d8cdff494'
'19ca886975716c02d6de9fd41b8297a4e1774be2'
PLATFORM = {
'cygwin': 'win32',

112
script/prerelease.js Executable file
View File

@@ -0,0 +1,112 @@
#!/usr/bin/env node
require('colors')
const assert = require('assert')
const GitHub = require('github')
const heads = require('heads')
const pkg = require('../package.json')
const pass = '\u2713'.green
const fail = '\u2717'.red
let failureCount = 0
assert(process.env.ELECTRON_GITHUB_TOKEN, 'ELECTRON_GITHUB_TOKEN not found in environment')
const github = new GitHub()
github.authenticate({type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN})
github.repos.getReleases({owner: 'electron', repo: 'electron'})
.then(res => {
const releases = res.data
const drafts = releases
.filter(release => release.draft) // comment out for testing
// .filter(release => release.tag_name === 'v1.7.5') // uncomment for testing
check(drafts.length === 1, 'one draft exists', true)
const draft = drafts[0]
check(draft.tag_name === `v${pkg.version}`, `draft release version matches local package.json (v${pkg.version})`)
check(draft.prerelease, 'draft is a prerelease')
check(draft.body.length > 50 && !draft.body.includes('(placeholder)'), 'draft has release notes')
const requiredAssets = assetsForVersion(draft.tag_name).sort()
const extantAssets = draft.assets.map(asset => asset.name).sort()
requiredAssets.forEach(asset => {
check(extantAssets.includes(asset), asset)
})
const s3Urls = s3UrlsForVersion(draft.tag_name)
heads(s3Urls)
.then(results => {
results.forEach((result, i) => {
check(result === 200, s3Urls[i])
})
process.exit(failureCount > 0 ? 1 : 0)
})
.catch(err => {
console.error('Error making HEAD requests for S3 assets')
console.error(err)
process.exit(1)
})
})
function check (condition, statement, exitIfFail = false) {
if (condition) {
console.log(`${pass} ${statement}`)
} else {
failureCount++
console.log(`${fail} ${statement}`)
if (exitIfFail) process.exit(1)
}
}
function assetsForVersion (version) {
const patterns = [
'electron-{{VERSION}}-darwin-x64-dsym.zip',
'electron-{{VERSION}}-darwin-x64-symbols.zip',
'electron-{{VERSION}}-darwin-x64.zip',
'electron-{{VERSION}}-linux-arm-symbols.zip',
'electron-{{VERSION}}-linux-arm.zip',
'electron-{{VERSION}}-linux-armv7l-symbols.zip',
'electron-{{VERSION}}-linux-armv7l.zip',
'electron-{{VERSION}}-linux-ia32-symbols.zip',
'electron-{{VERSION}}-linux-ia32.zip',
'electron-{{VERSION}}-linux-x64-symbols.zip',
'electron-{{VERSION}}-linux-x64.zip',
'electron-{{VERSION}}-mas-x64-dsym.zip',
'electron-{{VERSION}}-mas-x64-symbols.zip',
'electron-{{VERSION}}-mas-x64.zip',
'electron-{{VERSION}}-win32-ia32-pdb.zip',
'electron-{{VERSION}}-win32-ia32-symbols.zip',
'electron-{{VERSION}}-win32-ia32.zip',
'electron-{{VERSION}}-win32-x64-pdb.zip',
'electron-{{VERSION}}-win32-x64-symbols.zip',
'electron-{{VERSION}}-win32-x64.zip',
'electron-api.json',
'electron.d.ts',
'ffmpeg-{{VERSION}}-darwin-x64.zip',
'ffmpeg-{{VERSION}}-linux-arm.zip',
'ffmpeg-{{VERSION}}-linux-armv7l.zip',
'ffmpeg-{{VERSION}}-linux-ia32.zip',
'ffmpeg-{{VERSION}}-linux-x64.zip',
'ffmpeg-{{VERSION}}-mas-x64.zip',
'ffmpeg-{{VERSION}}-win32-ia32.zip',
'ffmpeg-{{VERSION}}-win32-x64.zip'
]
return patterns.map(pattern => pattern.replace(/{{VERSION}}/g, version))
}
function s3UrlsForVersion (version) {
const bucket = 'https://gh-contractor-zcbenz.s3.amazonaws.com/'
const patterns = [
'atom-shell/dist/{{VERSION}}/iojs-{{VERSION}}-headers.tar.gz',
'atom-shell/dist/{{VERSION}}/iojs-{{VERSION}}.tar.gz',
'atom-shell/dist/{{VERSION}}/node-{{VERSION}}.tar.gz',
'atom-shell/dist/{{VERSION}}/node.lib',
'atom-shell/dist/{{VERSION}}/win-x64/iojs.lib',
'atom-shell/dist/{{VERSION}}/win-x86/iojs.lib',
'atom-shell/dist/{{VERSION}}/x64/node.lib',
'atom-shell/dist/index.json'
]
return patterns.map(pattern => bucket + pattern.replace(/{{VERSION}}/g, version))
}

125
script/publish-to-npm.js Normal file
View File

@@ -0,0 +1,125 @@
const temp = require('temp')
const fs = require('fs')
const path = require('path')
const childProcess = require('child_process')
const GitHubApi = require('github')
const request = require('request')
const assert = require('assert')
const rootPackageJson = require('../package.json')
const github = new GitHubApi({
// debug: true,
headers: { 'User-Agent': 'electron-npm-publisher' },
followRedirects: false
})
let tempDir
temp.track() // track and cleanup files at exit
const files = [
'cli.js',
'index.js',
'install.js',
'package.json',
'README.md'
]
const jsonFields = [
'name',
'version',
'repository',
'description',
'license',
'author',
'keywords'
]
let npmTag = ''
new Promise((resolve, reject) => {
temp.mkdir('electron-npm', (err, dirPath) => {
if (err) {
reject(err)
} else {
resolve(dirPath)
}
})
})
.then((dirPath) => {
tempDir = dirPath
// copy files from `/npm` to temp directory
files.forEach((name) => {
fs.writeFileSync(
path.join(tempDir, name),
fs.readFileSync(path.join(__dirname, '..', name === 'README.md' ? '' : 'npm', name))
)
})
// copy from root package.json to temp/package.json
const packageJson = require(path.join(tempDir, 'package.json'))
jsonFields.forEach((fieldName) => {
packageJson[fieldName] = rootPackageJson[fieldName]
})
fs.writeFileSync(
path.join(tempDir, 'package.json'),
JSON.stringify(packageJson, null, 2)
)
return github.repos.getReleases({
owner: 'electron',
repo: 'electron'
})
})
.then((releases) => {
// download electron.d.ts from release
const release = releases.data.find(
(release) => release.tag_name === `v${rootPackageJson.version}`
)
if (!release) {
throw new Error(`cannot find release with tag v${rootPackageJson.version}`)
}
return release
})
.then((release) => {
const tsdAsset = release.assets.find((asset) => asset.name === 'electron.d.ts')
if (!tsdAsset) {
throw new Error(`cannot find electron.d.ts from v${rootPackageJson.version} release assets`)
}
return new Promise((resolve, reject) => {
request.get({
url: tsdAsset.url,
headers: {
'accept': 'application/octet-stream',
'user-agent': 'electron-npm-publisher'
}
}, (err, response, body) => {
if (err || response.statusCode !== 200) {
reject(err || new Error('Cannot download electron.d.ts'))
} else {
fs.writeFileSync(path.join(tempDir, 'electron.d.ts'), body)
resolve(release)
}
})
})
})
.then((release) => {
npmTag = release.prerelease ? 'beta' : 'latest'
})
.then(() => childProcess.execSync('npm pack', { cwd: tempDir }))
.then(() => {
// test that the package can install electron prebuilt from github release
const tarballPath = path.join(tempDir, `${rootPackageJson.name}-${rootPackageJson.version}.tgz`)
return new Promise((resolve, reject) => {
childProcess.execSync(`npm install ${tarballPath} --force --silent`, {
env: Object.assign({}, process.env, { electron_config_cache: tempDir }),
cwd: tempDir
})
const checkVersion = childProcess.execSync(`${path.join(tempDir, 'node_modules', '.bin', 'electron')} -v`)
assert.strictEqual(checkVersion.toString().trim(), `v${rootPackageJson.version}`)
resolve(tarballPath)
})
})
.then((tarballPath) => childProcess.execSync(`npm publish ${tarballPath} --tag ${npmTag}`))
.catch((err) => {
console.error(`Error: ${err}`)
process.exit(1)
})

View File

@@ -0,0 +1,21 @@
const GitHub = require('github')
const github = new GitHub()
github.authenticate({type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN})
let filePath = process.argv[2]
let fileName = process.argv[3]
let releaseId = process.argv[4]
let githubOpts = {
owner: 'electron',
repo: 'electron',
id: releaseId,
filePath: filePath,
name: fileName
}
github.repos.uploadAsset(githubOpts).then(() => {
process.exit()
}).catch((err) => {
console.log(`Error uploading ${fileName} to GitHub:`, err)
process.exitCode = 1
})

View File

@@ -67,7 +67,7 @@ def main():
run_python_script('upload-index-json.py')
# Create and upload the Electron SHASUMS*.txt
release_electron_checksums(github, release)
release_electron_checksums(release)
# Press the publish button.
publish_release(github, release['id'])
@@ -189,17 +189,20 @@ def create_release_draft(github, tag):
if body == '':
sys.stderr.write('Quit due to empty release note.\n')
sys.exit(0)
data = dict(tag_name=tag, name=name, body=body, draft=True)
data = dict(tag_name=tag, name=name, body=body, draft=True,
target_commitish='1-6-x')
r = github.repos(ELECTRON_REPO).releases.post(data=data)
return r
def release_electron_checksums(github, release):
def release_electron_checksums(release):
checksums = run_python_script('merge-electron-checksums.py',
'-v', ELECTRON_VERSION)
upload_io_to_github(github, release, 'SHASUMS256.txt',
StringIO(checksums.decode('utf-8')), 'text/plain')
filename = 'SHASUMS256.txt'
filepath = os.path.join(SOURCE_ROOT, filename)
with open(filepath, 'w') as sha_file:
sha_file.write(checksums.decode('utf-8'))
upload_io_to_github(release, filename, filepath)
def upload_electron(github, release, file_path):
@@ -214,8 +217,7 @@ def upload_electron(github, release, file_path):
pass
# Upload the file.
with open(file_path, 'rb') as f:
upload_io_to_github(github, release, filename, f, 'application/zip')
upload_io_to_github(release, filename, file_path)
# Upload the checksum file.
upload_sha256_checksum(release['tag_name'], file_path)
@@ -229,11 +231,11 @@ def upload_electron(github, release, file_path):
upload_electron(github, release, arm_file_path)
def upload_io_to_github(github, release, name, io, content_type):
params = {'name': name}
headers = {'Content-Type': content_type}
github.repos(ELECTRON_REPO).releases(release['id']).assets.post(
params=params, headers=headers, data=io, verify=False)
def upload_io_to_github(release, filename, filepath):
print 'Uploading %s to Github' % \
(filename)
script_path = os.path.join(SOURCE_ROOT, 'script', 'upload-to-github.js')
execute(['node', script_path, filepath, filename, str(release['id'])])
def upload_sha256_checksum(version, file_path):

View File

@@ -208,7 +208,7 @@ describe('app module', function () {
})
})
describe('app.importCertificate', function () {
xdescribe('app.importCertificate', function () {
if (process.platform !== 'linux') return
var w = null
@@ -405,7 +405,7 @@ describe('app module', function () {
})
})
describe('select-client-certificate event', function () {
xdescribe('select-client-certificate event', function () {
let w = null
beforeEach(function () {

View File

@@ -1161,7 +1161,6 @@ describe('BrowserWindow module', function () {
}
})
w.loadURL('file://' + path.join(fixtures, 'api', 'sandbox.html?allocate-memory'))
w.webContents.openDevTools({mode: 'detach'})
ipcMain.once('answer', function (event, {bytesBeforeOpen, bytesAfterOpen, bytesAfterClose}) {
const memoryIncreaseByOpen = bytesAfterOpen - bytesBeforeOpen
const memoryDecreaseByClose = bytesAfterOpen - bytesAfterClose
@@ -1173,6 +1172,73 @@ describe('BrowserWindow module', function () {
done()
})
})
// see #9387
it('properly manages remote object references after page reload', (done) => {
w.destroy()
w = new BrowserWindow({
show: false,
webPreferences: {
preload: preload,
sandbox: true
}
})
w.loadURL('file://' + path.join(fixtures, 'api', 'sandbox.html?reload-remote'))
ipcMain.on('get-remote-module-path', (event) => {
event.returnValue = path.join(fixtures, 'module', 'hello.js')
})
let reload = false
ipcMain.on('reloaded', (event) => {
event.returnValue = reload
reload = !reload
})
ipcMain.once('reload', (event) => {
event.sender.reload()
})
ipcMain.once('answer', (event, arg) => {
ipcMain.removeAllListeners('reloaded')
ipcMain.removeAllListeners('get-remote-module-path')
assert.equal(arg, 'hi')
done()
})
})
it('properly manages remote object references after page reload in child window', (done) => {
w.destroy()
w = new BrowserWindow({
show: false,
webPreferences: {
preload: preload,
sandbox: true
}
})
w.loadURL('file://' + path.join(fixtures, 'api', 'sandbox.html?reload-remote-child'))
ipcMain.on('get-remote-module-path', (event) => {
event.returnValue = path.join(fixtures, 'module', 'hello-child.js')
})
let reload = false
ipcMain.on('reloaded', (event) => {
event.returnValue = reload
reload = !reload
})
ipcMain.once('reload', (event) => {
event.sender.reload()
})
ipcMain.once('answer', (event, arg) => {
ipcMain.removeAllListeners('reloaded')
ipcMain.removeAllListeners('get-remote-module-path')
assert.equal(arg, 'hi child window')
done()
})
})
})
})

View File

@@ -9,6 +9,7 @@ const url = require('url')
const {closeWindow} = require('./window-helpers')
const {remote} = require('electron')
const isCI = remote.getGlobal('isCi')
const {app, BrowserWindow, crashReporter} = remote.require('electron')
describe('crashReporter module', function () {
@@ -16,6 +17,12 @@ describe('crashReporter module', function () {
return
}
// FIXME internal Linux CI is failing when it detects a process crashes
// which is a false positive here since crashes are explicitly triggered
if (isCI && process.platform === 'linux') {
return
}
var originalTempDirectory = null
var tempDirectory = null

View File

@@ -952,16 +952,18 @@ describe('chromium feature', function () {
slashes: true
})
beforeEach(function () {
function createBrowserWindow ({plugins}) {
w = new BrowserWindow({
show: false,
webPreferences: {
preload: path.join(fixtures, 'module', 'preload-inject-ipc.js')
preload: path.join(fixtures, 'module', 'preload-inject-ipc.js'),
plugins: plugins
}
})
})
}
it('opens when loading a pdf resource as top level navigation', function (done) {
createBrowserWindow({plugins: true})
ipcMain.once('pdf-loaded', function (event, success) {
if (success) done()
})
@@ -983,7 +985,21 @@ describe('chromium feature', function () {
w.webContents.loadURL(pdfSource)
})
it('should download a pdf when plugins are disabled', function (done) {
createBrowserWindow({plugins: false})
ipcRenderer.sendSync('set-download-option', false, false)
ipcRenderer.once('download-done', function (event, state, url, mimeType, receivedBytes, totalBytes, disposition, filename) {
assert.equal(state, 'completed')
assert.equal(filename, 'cat.pdf')
assert.equal(mimeType, 'application/pdf')
fs.unlinkSync(path.join(fixtures, 'mock.pdf'))
done()
})
w.webContents.loadURL(pdfSource)
})
it('should not open when pdf is requested as sub resource', function (done) {
createBrowserWindow({plugins: true})
webFrame.registerURLSchemeAsPrivileged('file', {
secure: false,
bypassCSP: false,

View File

@@ -13,13 +13,28 @@
await timeout(100)
}
}
if (window.opener) {
const [,test] = window.location.href.split('?')
if (window.opener && test !== 'reload-remote') {
window.callback = () => {
opener.require('electron').ipcRenderer.send('answer', document.body.innerHTML)
}
} else {
const {ipcRenderer} = require('electron')
const {ipcRenderer, remote} = require('electron')
const tests = {
'reload-remote-child': () => {
open(`${location.protocol}//${location.pathname}?reload-remote`)
},
'reload-remote': async () => {
const p = ipcRenderer.sendSync('get-remote-module-path')
const Hello = remote.require(p)
if (!ipcRenderer.sendSync('reloaded')) {
ipcRenderer.send('reload')
return
}
await invokeGc()
ipcRenderer.send('answer', new Hello().say())
},
'allocate-memory': async () => {
await invokeGc()
const {privateBytes: bytesBeforeOpen} = process.getProcessMemoryInfo()
@@ -95,7 +110,6 @@
popup.close()
}, false)
let [,test] = window.location.href.split('?')
if (tests.hasOwnProperty(test))
tests[test]()
}

6
spec/fixtures/module/hello-child.js vendored Normal file
View File

@@ -0,0 +1,6 @@
class Hello {
say () {
return 'hi child window'
}
}
module.exports = Hello

6
spec/fixtures/module/hello.js vendored Normal file
View File

@@ -0,0 +1,6 @@
class Hello {
say () {
return 'hi'
}
}
module.exports = Hello

View File

@@ -3,9 +3,9 @@
const {ipcRenderer} = require('electron')
window.ipcRenderer = ipcRenderer
window.setImmediate = setImmediate
window.require = require
if (location.protocol === 'file:') {
window.test = 'preload'
window.require = require
window.process = process
} else if (location.href !== 'about:blank') {
addEventListener('DOMContentLoaded', () => {

2
vendor/node vendored