diff --git a/docs/api/app.md b/docs/api/app.md index 4142baf97d..05bb19fef2 100755 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -1571,19 +1571,6 @@ This is the user agent that will be used when no user agent is set at the app has the same user agent. Set to a custom value as early as possible in your app's initialization to ensure that your overridden value is used. -### `app.runningUnderRosettaTranslation` _macOS_ _Readonly_ _Deprecated_ - -A `boolean` which when `true` indicates that the app is currently running -under the [Rosetta Translator Environment](https://en.wikipedia.org/wiki/Rosetta_(software)). - -You can use this property to prompt users to download the arm64 version of -your application when they are running the x64 version under Rosetta -incorrectly. - -**Deprecated:** This property is superceded by the `runningUnderARM64Translation` -property which detects when the app is being translated to ARM64 in both macOS -and Windows. - ### `app.runningUnderARM64Translation` _Readonly_ _macOS_ _Windows_ A `boolean` which when `true` indicates that the app is currently running under diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index 69492c43f2..92192ae54d 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -63,6 +63,18 @@ The `ipcRenderer.sendTo()` API has been removed. It should be replaced by settin The `senderId` and `senderIsMainFrame` properties of `IpcRendererEvent` have been removed as well. +### Removed: `app.runningUnderRosettaTranslation` + +The `app.runningUnderRosettaTranslation` property has been removed. +Use `app.runningUnderARM64Translation` instead. + +```js +// Removed +console.log(app.runningUnderRosettaTranslation) +// Replace with +console.log(app.runningUnderARM64Translation) +``` + ## Planned Breaking API Changes (27.0) ### Removed: macOS 10.13 / 10.14 support diff --git a/shell/browser/api/electron_api_app.cc b/shell/browser/api/electron_api_app.cc index 51fe3cffd5..63debcde56 100644 --- a/shell/browser/api/electron_api_app.cc +++ b/shell/browser/api/electron_api_app.cc @@ -1767,8 +1767,6 @@ gin::ObjectTemplateBuilder App::GetObjectTemplateBuilder(v8::Isolate* isolate) { #endif #if BUILDFLAG(IS_MAC) .SetProperty("dock", &App::GetDockAPI) - .SetProperty("runningUnderRosettaTranslation", - &App::IsRunningUnderRosettaTranslation) #endif #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) .SetProperty("runningUnderARM64Translation", diff --git a/shell/browser/api/electron_api_app.h b/shell/browser/api/electron_api_app.h index 570d62aa4b..3b4d15c189 100644 --- a/shell/browser/api/electron_api_app.h +++ b/shell/browser/api/electron_api_app.h @@ -229,7 +229,6 @@ class App : public ElectronBrowserClient::Delegate, bool MoveToApplicationsFolder(gin_helper::ErrorThrower, gin::Arguments* args); bool IsInApplicationsFolder(); v8::Local GetDockAPI(v8::Isolate* isolate); - bool IsRunningUnderRosettaTranslation() const; v8::Global dock_; #endif diff --git a/shell/browser/api/electron_api_app_mac.mm b/shell/browser/api/electron_api_app_mac.mm index 4da52b61c5..9b244c8f1b 100644 --- a/shell/browser/api/electron_api_app_mac.mm +++ b/shell/browser/api/electron_api_app_mac.mm @@ -60,17 +60,6 @@ void App::SetActivationPolicy(gin_helper::ErrorThrower thrower, [NSApp setActivationPolicy:activation_policy]; } -bool App::IsRunningUnderRosettaTranslation() const { - node::Environment* env = - node::Environment::GetCurrent(JavascriptEnvironment::GetIsolate()); - - EmitWarning(env, - "The app.runningUnderRosettaTranslation API is deprecated, use " - "app.runningUnderARM64Translation instead.", - "electron"); - return IsRunningUnderARM64Translation(); -} - bool App::IsRunningUnderARM64Translation() const { int proc_translated = 0; size_t size = sizeof(proc_translated); diff --git a/spec/ts-smoke/electron/main.ts b/spec/ts-smoke/electron/main.ts index 11bc068af0..7e30c40f07 100644 --- a/spec/ts-smoke/electron/main.ts +++ b/spec/ts-smoke/electron/main.ts @@ -427,6 +427,9 @@ win2.once('ready-to-show', () => { app.relaunch({ args: process.argv.slice(1).concat(['--relaunch']) }); app.exit(0); +// @ts-expect-error Removed API +console.log(app.runningUnderRosettaTranslation); + // auto-updater // https://github.com/electron/electron/blob/main/docs/api/auto-updater.md