Skip to content

Commit 612361c

Browse files
authored
chore: remove unused getWebPreferences method (electron#30160)
1 parent a329842 commit 612361c

File tree

3 files changed

+0
-20
lines changed

3 files changed

+0
-20
lines changed

shell/browser/api/electron_api_web_contents.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3052,14 +3052,6 @@ std::vector<base::FilePath> WebContents::GetPreloadPaths() const {
30523052
return result;
30533053
}
30543054

3055-
v8::Local<v8::Value> WebContents::GetWebPreferences(
3056-
v8::Isolate* isolate) const {
3057-
auto* web_preferences = WebContentsPreferences::From(web_contents());
3058-
if (!web_preferences)
3059-
return v8::Null(isolate);
3060-
return gin::ConvertToV8(isolate, *web_preferences->preference());
3061-
}
3062-
30633055
v8::Local<v8::Value> WebContents::GetLastWebPreferences(
30643056
v8::Isolate* isolate) const {
30653057
auto* web_preferences = WebContentsPreferences::From(web_contents());
@@ -3719,7 +3711,6 @@ v8::Local<v8::ObjectTemplate> WebContents::FillObjectTemplate(
37193711
.SetMethod("getZoomFactor", &WebContents::GetZoomFactor)
37203712
.SetMethod("getType", &WebContents::GetType)
37213713
.SetMethod("_getPreloadPaths", &WebContents::GetPreloadPaths)
3722-
.SetMethod("getWebPreferences", &WebContents::GetWebPreferences)
37233714
.SetMethod("getLastWebPreferences", &WebContents::GetLastWebPreferences)
37243715
.SetMethod("getOwnerBrowserWindow", &WebContents::GetOwnerBrowserWindow)
37253716
.SetMethod("inspectServiceWorker", &WebContents::InspectServiceWorker)

spec-main/api-web-contents-spec.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -503,16 +503,6 @@ describe('webContents module', () => {
503503
});
504504
});
505505

506-
describe('getWebPreferences() API', () => {
507-
afterEach(closeAllWindows);
508-
it('should not crash when called for devTools webContents', async () => {
509-
const w = new BrowserWindow({ show: false });
510-
w.webContents.openDevTools();
511-
await emittedOnce(w.webContents, 'devtools-opened');
512-
expect(w.webContents.devToolsWebContents!.getWebPreferences()).to.be.null();
513-
});
514-
});
515-
516506
describe('openDevTools() API', () => {
517507
afterEach(closeAllWindows);
518508
it('can show window with activation', async () => {

typings/internal-electron.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ declare namespace Electron {
5757
interface WebContents {
5858
_loadURL(url: string, options: ElectronInternal.LoadURLOptions): void;
5959
getOwnerBrowserWindow(): Electron.BrowserWindow;
60-
getWebPreferences(): Electron.WebPreferences;
6160
getLastWebPreferences(): Electron.WebPreferences;
6261
_getPreloadPaths(): string[];
6362
equal(other: WebContents): boolean;

0 commit comments

Comments
 (0)