Hello Electron Enthusiasts!
As a start, I've set myself a challenge to hardcode the window title, bypassing the dynamic title set via the <title> tag in HTML. My goal is to have a fixed title for every window in my Electron app, aiming to get a better grasp of Electron's architecture and source code manipulation. My journey into the heart of Electron began with building it from source using the @electron/build-tools. I've successfully set up and built my custom version of Electron by executing:
npm i -g @electron/build-toolse init --root=~/electron --bootstrap testinge build
After navigating to the out/Testing directory and runningelectron path-to-my-app, my application launched flawlessly on my custom-built Electron, confirming that the build was successful.
So, my next move was to hardcode the window titles in the Electron source code, looking to bypass those ever-changing titles pulled from the <title> tag. My modification was made in the chrome/browser/apps/app_service/browser_app_instance.cc file, where I adjusted the constructors and the MaybeUpdate method to set a hardcoded title in ctors, and MaybeUpdate method.
However, I'm facing two challenges:
- After making the changes, e build does not seem to detect them, indicating "ninja: no work to do." I attempted removing the out directory and rebuilding, yet the issue persists.
- Despite the rebuild, the application still fetches titles from the <title> tag, overlooking my hardcoded titles.
Any insights or suggestions on navigating these challenges would be immensely appreciated. Also, if you have any recommended materials, courses, or articles that were helpful for you at the beginning, I’d be more than happy to check them out!
Thank you for your time and expertise!
Best,
Mafi