chore: remove unused getWebPreferences method (#30160)
This commit is contained in:
parent
a3298424b3
commit
612361c4da
3 changed files with 0 additions and 20 deletions
|
@ -3052,14 +3052,6 @@ std::vector<base::FilePath> WebContents::GetPreloadPaths() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
v8::Local<v8::Value> WebContents::GetWebPreferences(
|
|
||||||
v8::Isolate* isolate) const {
|
|
||||||
auto* web_preferences = WebContentsPreferences::From(web_contents());
|
|
||||||
if (!web_preferences)
|
|
||||||
return v8::Null(isolate);
|
|
||||||
return gin::ConvertToV8(isolate, *web_preferences->preference());
|
|
||||||
}
|
|
||||||
|
|
||||||
v8::Local<v8::Value> WebContents::GetLastWebPreferences(
|
v8::Local<v8::Value> WebContents::GetLastWebPreferences(
|
||||||
v8::Isolate* isolate) const {
|
v8::Isolate* isolate) const {
|
||||||
auto* web_preferences = WebContentsPreferences::From(web_contents());
|
auto* web_preferences = WebContentsPreferences::From(web_contents());
|
||||||
|
@ -3719,7 +3711,6 @@ v8::Local<v8::ObjectTemplate> WebContents::FillObjectTemplate(
|
||||||
.SetMethod("getZoomFactor", &WebContents::GetZoomFactor)
|
.SetMethod("getZoomFactor", &WebContents::GetZoomFactor)
|
||||||
.SetMethod("getType", &WebContents::GetType)
|
.SetMethod("getType", &WebContents::GetType)
|
||||||
.SetMethod("_getPreloadPaths", &WebContents::GetPreloadPaths)
|
.SetMethod("_getPreloadPaths", &WebContents::GetPreloadPaths)
|
||||||
.SetMethod("getWebPreferences", &WebContents::GetWebPreferences)
|
|
||||||
.SetMethod("getLastWebPreferences", &WebContents::GetLastWebPreferences)
|
.SetMethod("getLastWebPreferences", &WebContents::GetLastWebPreferences)
|
||||||
.SetMethod("getOwnerBrowserWindow", &WebContents::GetOwnerBrowserWindow)
|
.SetMethod("getOwnerBrowserWindow", &WebContents::GetOwnerBrowserWindow)
|
||||||
.SetMethod("inspectServiceWorker", &WebContents::InspectServiceWorker)
|
.SetMethod("inspectServiceWorker", &WebContents::InspectServiceWorker)
|
||||||
|
|
|
@ -503,16 +503,6 @@ describe('webContents module', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getWebPreferences() API', () => {
|
|
||||||
afterEach(closeAllWindows);
|
|
||||||
it('should not crash when called for devTools webContents', async () => {
|
|
||||||
const w = new BrowserWindow({ show: false });
|
|
||||||
w.webContents.openDevTools();
|
|
||||||
await emittedOnce(w.webContents, 'devtools-opened');
|
|
||||||
expect(w.webContents.devToolsWebContents!.getWebPreferences()).to.be.null();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('openDevTools() API', () => {
|
describe('openDevTools() API', () => {
|
||||||
afterEach(closeAllWindows);
|
afterEach(closeAllWindows);
|
||||||
it('can show window with activation', async () => {
|
it('can show window with activation', async () => {
|
||||||
|
|
1
typings/internal-electron.d.ts
vendored
1
typings/internal-electron.d.ts
vendored
|
@ -57,7 +57,6 @@ declare namespace Electron {
|
||||||
interface WebContents {
|
interface WebContents {
|
||||||
_loadURL(url: string, options: ElectronInternal.LoadURLOptions): void;
|
_loadURL(url: string, options: ElectronInternal.LoadURLOptions): void;
|
||||||
getOwnerBrowserWindow(): Electron.BrowserWindow;
|
getOwnerBrowserWindow(): Electron.BrowserWindow;
|
||||||
getWebPreferences(): Electron.WebPreferences;
|
|
||||||
getLastWebPreferences(): Electron.WebPreferences;
|
getLastWebPreferences(): Electron.WebPreferences;
|
||||||
_getPreloadPaths(): string[];
|
_getPreloadPaths(): string[];
|
||||||
equal(other: WebContents): boolean;
|
equal(other: WebContents): boolean;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue