feat: add a 'title' parameter to openDevTools()
(#39047)
* [Feature Request]: Add a parameter to openDevTools() that sets the DevTools window title bar * all titles->title * add GetDevToolsTitle(),update docs * fix:lint error * fix:lint error * add setDevToolTitle * lint errror * lint errror * ling errror (.md) * build error * build error in mac * build error * build error * change docs * std::string->std::u16string * lint error * build error * build error
This commit is contained in:
parent
8e3dcc8b17
commit
127584dc37
13 changed files with 90 additions and 5 deletions
|
@ -608,6 +608,27 @@ describe('webContents module', () => {
|
|||
await devtoolsOpened;
|
||||
expect(w.webContents.isDevToolsOpened()).to.be.true();
|
||||
});
|
||||
|
||||
it('can show a DevTools window with custom title', async () => {
|
||||
const w = new BrowserWindow({ show: false });
|
||||
const devtoolsOpened = once(w.webContents, 'devtools-opened');
|
||||
w.webContents.openDevTools({ mode: 'detach', activate: false, title: 'myTitle' });
|
||||
await devtoolsOpened;
|
||||
expect(w.webContents.getDevToolsTitle()).to.equal('myTitle');
|
||||
});
|
||||
});
|
||||
|
||||
describe('setDevToolsTitle() API', () => {
|
||||
afterEach(closeAllWindows);
|
||||
it('can set devtools title with function', async () => {
|
||||
const w = new BrowserWindow({ show: false });
|
||||
const devtoolsOpened = once(w.webContents, 'devtools-opened');
|
||||
w.webContents.openDevTools({ mode: 'detach', activate: false });
|
||||
await devtoolsOpened;
|
||||
expect(w.webContents.isDevToolsOpened()).to.be.true();
|
||||
w.webContents.setDevToolsTitle('newTitle');
|
||||
expect(w.webContents.getDevToolsTitle()).to.equal('newTitle');
|
||||
});
|
||||
});
|
||||
|
||||
describe('before-input-event event', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue