How to set custom url like (xyz://settings)

614 views
Skip to first unread message

Toptech4

unread,
Mar 28, 2023, 4:57:58 AM3/28/23
to Chromium-dev
Hey chromium developers I hope you are all well. I have been facing trouble in setting my custom URL in chromium. Like for settings page the default URL is chrome://settings but I want to change it into xyz://settings. I want to change URLs of all pages in chromium.

Recently I found the file which is responsible for these URLs (webui_url_constants.cc) I also modified it according to my need but getting many errors. 
Can anyone help me out please I will be very thankful to him. 

Thanks in advance.
Regards:  Shah Zaman Haider

PhistucK

unread,
Mar 29, 2023, 11:35:46 AM3/29/23
to Toptech4, Jon Perryman, Chromium-dev
(Removing chromium-discuss and adding chromium-dev)

Have you checked image.png (or any other input optimize_webui.py has) for accidental replacements?

Also, is it correct to assume that you successfully built the browser once without any modification?



PhistucK


On Wed, Mar 29, 2023 at 4:17 PM Toptech4 <shahzama...@gmail.com> wrote:
I have done some changings like I replaced all chrome:// strings with myBrowser:// in chromium. After doing replacement work I build the code but a dialog box appears node.exe (Application error) it says that The application was unable to start correctly (0xc000007b). Click ok to close the application. When I click on ok the build stops and shows ninja errors which I shared below

On Tue, 28 Mar 2023, 11:35 pm Jon Perryman, <jon.pe...@gmail.com> wrote:
This group is more about using chromium. There is a chromium dev group which can be found on the chromium home  webpage.

Before you change anything, you should compile chromium and use it. Any problems at this point are specific to chromium. Any errors after this point are most likely specific to your changes.

If you get too many errors, then make smaller changes.

--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discu...@chromium.org.

Toptech4

unread,
Mar 29, 2023, 12:34:17 PM3/29/23
to PhistucK, Chromium-dev
I have used a tool for replacement task so I don't think that any replacement will be done wrong in any file. 

Yeah I built the browser before without any modifications. And it ran successfully.
image.png

PhistucK

unread,
Mar 29, 2023, 12:49:01 PM3/29/23
to Toptech4, Chromium-dev
Well, since it does not work, it looks like some replacement was incorrect, so try to review the changes made to the path I mentioned and other paths mentioned in that command...

PhistucK

PhistucK

unread,
Mar 29, 2023, 3:47:37 PM3/29/23
to Toptech4, Chromium-dev
So Vivaldi also does that, apparently and its source code is pretty much exposed, albeit in a less obvious way -

Someone created an outdated mirror, though -

Anyway, you can see what they did there (good luck ;)).

I suspect a possibly shorter way/workaround to do this would be at the network stack level and at the omnibox level -
- In the network stack - whenever xyz:// is encountered, replace with chrome://
- In the omnibox - whenever chrome:// is supposed to be shown, replace with xyz:// (and - optionally - whenever the user goes to xyz:// via the omnibox, change to chrome:// before you navigate, though the network stack would do that already)
- For a more complete experience, you can also change the status bubble so that the user will not see chrome:// when they hover over a link

It sounds a bit hacky, I know, but it might just be the most forward compatible way of doing it, as they keep adding more chrome:// pages and you will have to hunt them down every time if you do it the manual way.

This means that inspecting it via the developer tools, users will still see chrome://, but I doubt this is a real issue. 

PhistucK

guest271314

unread,
Mar 30, 2023, 10:06:38 AM3/30/23
to Chromium-dev, Toptech4
The requirement can be achieved using extension code. You can set the new tab page to a custom URL and redirect requests using declarativeNetRequest.
Reply all
Reply to author
Forward
0 new messages