For release 0.3, I have chosen to fix issue issue #6856 in the open source project Brave. This has proven to be quite the deceptively difficult issue. So much so that at the time of writing, I have yet to successfully fix it. In this post I hope to share my experiences trying to find a solutions.
The Issue:
The poster of the issue desired to have the “about:brave” page show additional information, namely the user’s DPI scaling on a windows machine, but a another user expanded to also include the OS built number, resolution, graphic board driver and name. While not too bad initially, it later proved to bear unforeseen challenges.
Potential Solutions:
I was able to quickly discover the file that populated the about page, and immediately began searching the web for sources of the above mentioned items.
First I began looking for a source of DPI scaling. This was a largely fruitless endeavor, as many search results pointed to irrelevant problems and solutions, all except one chrome://GPU.
This was what I was looking for. I have search the internet for the source code of the chrome web browser and began to analyze it. Picking it apart trying to figure out how it got these specs and how to incorporate it into brave. Alas I have hit a snag. To acquire the information, chrome uses a function called browser-bridge. This function is dependent on a file called cr.js, which is reliant on the use of DHTML. This ended any hope of incorporating it into Brave, as Brave does not use DHTML and I don’t know how to work around it. This was my best lead to find the DPI.
Failing to assimilate chrome’s GPU page, I have switched priorities to focused on getting the other items to display. Specifically the resolution. While I have come across many potential solutions, none really sickout in mind at the time of writing, I have settled with the library ,systemInformation. It has proven(in some cause) to be compatible with Brave, when getting memory, and CPU specs. Unfortunately, it can’t seem to detect the monitor nor the GPU of my laptop. I intend to test it on other devices or potentially relocate the fetch to another file.
This is what I have at the moment: