Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4f65b914
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
4f65b914
编写于
6月 28, 2020
作者:
B
Benjamin Pasero
提交者:
GitHub
6月 28, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
electron - disable remote module in all windows (#101224)
上级
c5237f6d
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
22 addition
and
10 deletion
+22
-10
src/vs/code/electron-main/app.ts
src/vs/code/electron-main/app.ts
+5
-1
src/vs/code/electron-main/auth.ts
src/vs/code/electron-main/auth.ts
+1
-1
src/vs/code/electron-main/sharedProcess.ts
src/vs/code/electron-main/sharedProcess.ts
+1
-0
src/vs/code/electron-main/window.ts
src/vs/code/electron-main/window.ts
+1
-3
src/vs/platform/driver/electron-browser/driver.ts
src/vs/platform/driver/electron-browser/driver.ts
+2
-4
src/vs/platform/electron/common/electron.ts
src/vs/platform/electron/common/electron.ts
+1
-0
src/vs/platform/electron/electron-main/electronMainService.ts
...vs/platform/electron/electron-main/electronMainService.ts
+7
-0
src/vs/platform/issue/electron-main/issueMainService.ts
src/vs/platform/issue/electron-main/issueMainService.ts
+2
-0
src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts
...Editor/browser/suggestEnabledInput/suggestEnabledInput.ts
+0
-1
src/vs/workbench/test/electron-browser/workbenchTestServices.ts
.../workbench/test/electron-browser/workbenchTestServices.ts
+1
-0
test/unit/electron/index.js
test/unit/electron/index.js
+1
-0
未找到文件。
src/vs/code/electron-main/app.ts
浏览文件 @
4f65b914
...
...
@@ -134,7 +134,11 @@ export class CodeApplication extends Disposable {
//
// !!! DO NOT CHANGE without consulting the documentation !!!
//
// app.on('remote-get-guest-web-contents', event => event.preventDefault()); // TODO@Matt revisit this need for <webview>
app
.
on
(
'
remote-get-guest-web-contents
'
,
event
=>
{
this
.
logService
.
trace
(
'
App#on(remote-get-guest-web-contents): prevented
'
);
event
.
preventDefault
();
});
app
.
on
(
'
remote-require
'
,
(
event
,
sender
,
module
)
=>
{
this
.
logService
.
trace
(
'
App#on(remote-require): prevented
'
);
...
...
src/vs/code/electron-main/auth.ts
浏览文件 @
4f65b914
...
...
@@ -59,8 +59,8 @@ export class ProxyAuthHandler extends Disposable {
title
:
'
VS Code
'
,
webPreferences
:
{
nodeIntegration
:
true
,
webviewTag
:
true
,
enableWebSQL
:
false
,
enableRemoteModule
:
false
,
nativeWindowOpen
:
true
}
};
...
...
src/vs/code/electron-main/sharedProcess.ts
浏览文件 @
4f65b914
...
...
@@ -47,6 +47,7 @@ export class SharedProcess implements ISharedProcess {
nodeIntegration
:
true
,
webgl
:
false
,
enableWebSQL
:
false
,
enableRemoteModule
:
false
,
nativeWindowOpen
:
true
,
disableBlinkFeatures
:
'
Auxclick
'
// do NOT change, allows us to identify this window as shared-process in the process explorer
}
...
...
src/vs/code/electron-main/window.ts
浏览文件 @
4f65b914
...
...
@@ -36,8 +36,6 @@ import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifec
import
{
IStorageMainService
}
from
'
vs/platform/storage/node/storageMainService
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
const
RUN_TEXTMATE_IN_WORKER
=
false
;
export
interface
IWindowCreationOptions
{
state
:
IWindowState
;
extensionDevelopmentPath
?:
string
[];
...
...
@@ -168,9 +166,9 @@ export class CodeWindow extends Disposable implements ICodeWindow {
webPreferences
:
{
preload
:
URI
.
parse
(
this
.
doGetPreloadUrl
()).
fsPath
,
nodeIntegration
:
true
,
nodeIntegrationInWorker
:
RUN_TEXTMATE_IN_WORKER
,
webviewTag
:
true
,
enableWebSQL
:
false
,
enableRemoteModule
:
false
,
nativeWindowOpen
:
true
}
};
...
...
src/vs/platform/driver/electron-browser/driver.ts
浏览文件 @
4f65b914
...
...
@@ -7,7 +7,6 @@ import { IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import
{
WindowDriverChannel
,
WindowDriverRegistryChannelClient
}
from
'
vs/platform/driver/node/driver
'
;
import
{
IInstantiationService
,
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-sandbox/mainProcessService
'
;
import
{
remote
}
from
'
electron
'
;
import
{
timeout
}
from
'
vs/base/common/async
'
;
import
{
BaseWindowDriver
}
from
'
vs/platform/driver/browser/baseDriver
'
;
import
{
IElectronService
}
from
'
vs/platform/electron/electron-sandbox/electron
'
;
...
...
@@ -32,11 +31,10 @@ class WindowDriver extends BaseWindowDriver {
private
async
_click
(
selector
:
string
,
clickCount
:
number
,
offset
?:
{
x
:
number
,
y
:
number
}):
Promise
<
void
>
{
const
{
x
,
y
}
=
await
this
.
_getElementXY
(
selector
,
offset
);
const
webContents
=
remote
.
getCurrentWebContents
();
webContents
.
sendInputEvent
({
type
:
'
mouseDown
'
,
x
,
y
,
button
:
'
left
'
,
clickCount
}
as
any
);
await
this
.
electronService
.
sendInputEvent
({
type
:
'
mouseDown
'
,
x
,
y
,
button
:
'
left
'
,
clickCount
}
as
any
);
await
timeout
(
10
);
webContents
.
sendInputEvent
({
type
:
'
mouseUp
'
,
x
,
y
,
button
:
'
left
'
,
clickCount
}
as
any
);
await
this
.
electronService
.
sendInputEvent
({
type
:
'
mouseUp
'
,
x
,
y
,
button
:
'
left
'
,
clickCount
}
as
any
);
await
timeout
(
100
);
}
...
...
src/vs/platform/electron/common/electron.ts
浏览文件 @
4f65b914
...
...
@@ -94,6 +94,7 @@ export interface ICommonElectronService {
openDevTools
(
options
?:
OpenDevToolsOptions
):
Promise
<
void
>
;
toggleDevTools
():
Promise
<
void
>
;
startCrashReporter
(
options
:
CrashReporterStartOptions
):
Promise
<
void
>
;
sendInputEvent
(
event
:
{
type
:
'
mouseDown
'
|
'
mouseUp
'
;
x
:
number
;
y
:
number
;
clickCount
:
number
;
}):
Promise
<
void
>
;
// Connectivity
resolveProxy
(
url
:
string
):
Promise
<
string
|
undefined
>
;
...
...
src/vs/platform/electron/electron-main/electronMainService.ts
浏览文件 @
4f65b914
...
...
@@ -459,6 +459,13 @@ export class ElectronMainService implements IElectronMainService {
crashReporter
.
start
(
options
);
}
async
sendInputEvent
(
windowId
:
number
|
undefined
,
event
:
{
type
:
'
mouseDown
'
|
'
mouseUp
'
;
x
:
number
;
y
:
number
;
clickCount
:
number
;
}):
Promise
<
void
>
{
const
window
=
this
.
windowById
(
windowId
);
if
(
window
&&
(
event
.
type
===
'
mouseDown
'
||
event
.
type
===
'
mouseUp
'
))
{
window
.
win
.
webContents
.
sendInputEvent
(
event
);
}
}
//#endregion
private
windowById
(
windowId
:
number
|
undefined
):
ICodeWindow
|
undefined
{
...
...
src/vs/platform/issue/electron-main/issueMainService.ts
浏览文件 @
4f65b914
...
...
@@ -197,6 +197,7 @@ export class IssueMainService implements ICommonIssueService {
preload
:
URI
.
parse
(
require
.
toUrl
(
'
vs/base/parts/sandbox/electron-browser/preload.js
'
)).
fsPath
,
nodeIntegration
:
true
,
enableWebSQL
:
false
,
enableRemoteModule
:
false
,
nativeWindowOpen
:
true
}
});
...
...
@@ -249,6 +250,7 @@ export class IssueMainService implements ICommonIssueService {
preload
:
URI
.
parse
(
require
.
toUrl
(
'
vs/base/parts/sandbox/electron-browser/preload.js
'
)).
fsPath
,
nodeIntegration
:
true
,
enableWebSQL
:
false
,
enableRemoteModule
:
false
,
nativeWindowOpen
:
true
}
});
...
...
src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts
浏览文件 @
4f65b914
...
...
@@ -314,7 +314,6 @@ function getSuggestEnabledInputOptions(ariaLabel?: string): IEditorOptions {
cursorWidth
:
1
,
fontFamily
:
DEFAULT_FONT_FAMILY
,
ariaLabel
:
ariaLabel
||
''
,
snippetSuggestions
:
'
none
'
,
suggest
:
{
filterGraceful
:
false
,
showIcons
:
false
},
autoClosingBrackets
:
'
never
'
...
...
src/vs/workbench/test/electron-browser/workbenchTestServices.ts
浏览文件 @
4f65b914
...
...
@@ -232,6 +232,7 @@ export class TestElectronService implements IElectronService {
async
writeClipboardBuffer
(
format
:
string
,
buffer
:
Uint8Array
,
type
?:
'
selection
'
|
'
clipboard
'
|
undefined
):
Promise
<
void
>
{
}
async
readClipboardBuffer
(
format
:
string
):
Promise
<
Uint8Array
>
{
return
Uint8Array
.
from
([]);
}
async
hasClipboard
(
format
:
string
,
type
?:
'
selection
'
|
'
clipboard
'
|
undefined
):
Promise
<
boolean
>
{
return
false
;
}
async
sendInputEvent
(
event
:
{
type
:
'
mouseDown
'
|
'
mouseUp
'
;
x
:
number
;
y
:
number
;
clickCount
:
number
;
}):
Promise
<
void
>
{
}
}
export
function
workbenchInstantiationService
():
ITestInstantiationService
{
...
...
test/unit/electron/index.js
浏览文件 @
4f65b914
...
...
@@ -118,6 +118,7 @@ app.on('ready', () => {
webviewTag
:
true
,
preload
:
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
,
'
..
'
,
'
src
'
,
'
vs
'
,
'
base
'
,
'
parts
'
,
'
sandbox
'
,
'
electron-browser
'
,
'
preload.js
'
),
// ensure similar environment as VSCode as tests may depend on this
enableWebSQL
:
false
,
enableRemoteModule
:
false
,
nativeWindowOpen
:
true
}
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录