chore: rename process.contextIsolation to process.contextIsolated (#28259)
* chore: rename process.contextIsolation to process.contextIsolated * thing
This commit is contained in:
parent
4057e6b56e
commit
f35fc93080
5 changed files with 7 additions and 7 deletions
|
@ -30,7 +30,7 @@ In sandboxed renderers the `process` object contains only a subset of the APIs:
|
||||||
* `arch`
|
* `arch`
|
||||||
* `platform`
|
* `platform`
|
||||||
* `sandboxed`
|
* `sandboxed`
|
||||||
* `contextIsolation`
|
* `contextIsolated`
|
||||||
* `type`
|
* `type`
|
||||||
* `version`
|
* `version`
|
||||||
* `versions`
|
* `versions`
|
||||||
|
@ -95,7 +95,7 @@ A `String` representing the path to the resources directory.
|
||||||
A `Boolean`. When the renderer process is sandboxed, this property is `true`,
|
A `Boolean`. When the renderer process is sandboxed, this property is `true`,
|
||||||
otherwise it is `undefined`.
|
otherwise it is `undefined`.
|
||||||
|
|
||||||
### `process.contextIsolation` _Readonly_
|
### `process.contextIsolated` _Readonly_
|
||||||
|
|
||||||
A `Boolean` that indicates whether the current renderer context has `contextIsolation` enabled.
|
A `Boolean` that indicates whether the current renderer context has `contextIsolation` enabled.
|
||||||
It is `undefined` in the main process.
|
It is `undefined` in the main process.
|
||||||
|
|
|
@ -141,7 +141,7 @@ void RendererClientBase::BindProcess(v8::Isolate* isolate,
|
||||||
gin_helper::Dictionary* process,
|
gin_helper::Dictionary* process,
|
||||||
content::RenderFrame* render_frame) {
|
content::RenderFrame* render_frame) {
|
||||||
process->SetReadOnly("isMainFrame", render_frame->IsMainFrame());
|
process->SetReadOnly("isMainFrame", render_frame->IsMainFrame());
|
||||||
process->SetReadOnly("contextIsolation",
|
process->SetReadOnly("contextIsolated",
|
||||||
render_frame->GetBlinkPreferences().context_isolation);
|
render_frame->GetBlinkPreferences().context_isolation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2487,7 +2487,7 @@ describe('BrowserWindow module', () => {
|
||||||
expect(test.env).to.deep.equal(process.env);
|
expect(test.env).to.deep.equal(process.env);
|
||||||
expect(test.execPath).to.equal(process.helperExecPath);
|
expect(test.execPath).to.equal(process.helperExecPath);
|
||||||
expect(test.sandboxed).to.be.true('sandboxed');
|
expect(test.sandboxed).to.be.true('sandboxed');
|
||||||
expect(test.contextIsolation).to.be.false('contextIsolation');
|
expect(test.contextIsolated).to.be.false('contextIsolated');
|
||||||
expect(test.type).to.equal('renderer');
|
expect(test.type).to.equal('renderer');
|
||||||
expect(test.version).to.equal(process.version);
|
expect(test.version).to.equal(process.version);
|
||||||
expect(test.versions).to.deep.equal(process.versions);
|
expect(test.versions).to.deep.equal(process.versions);
|
||||||
|
@ -4306,7 +4306,7 @@ describe('BrowserWindow module', () => {
|
||||||
const [, data] = await p;
|
const [, data] = await p;
|
||||||
expect(data.pageContext.openedLocation).to.equal('about:blank');
|
expect(data.pageContext.openedLocation).to.equal('about:blank');
|
||||||
});
|
});
|
||||||
it('reports process.contextIsolation', async () => {
|
it('reports process.contextIsolated', async () => {
|
||||||
const iw = new BrowserWindow({
|
const iw = new BrowserWindow({
|
||||||
show: false,
|
show: false,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
arch: process.arch,
|
arch: process.arch,
|
||||||
platform: process.platform,
|
platform: process.platform,
|
||||||
sandboxed: process.sandboxed,
|
sandboxed: process.sandboxed,
|
||||||
contextIsolation: process.contextIsolation,
|
contextIsolated: process.contextIsolated,
|
||||||
type: process.type,
|
type: process.type,
|
||||||
version: process.version,
|
version: process.version,
|
||||||
versions: process.versions,
|
versions: process.versions,
|
||||||
|
|
2
spec/fixtures/api/isolated-process.js
vendored
2
spec/fixtures/api/isolated-process.js
vendored
|
@ -1,3 +1,3 @@
|
||||||
const { ipcRenderer } = require('electron');
|
const { ipcRenderer } = require('electron');
|
||||||
|
|
||||||
ipcRenderer.send('context-isolation', process.contextIsolation);
|
ipcRenderer.send('context-isolation', process.contextIsolated);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue