Open a Link in google chrome using QT
-
Hello
iam want to open a link in google chrome browser so I use this codeQString link = "http://www.google.com"; QDesktopServices::openUrl(QUrl(link));
but here is the problem when i use this link to open it in chrome
chrome://settings/
any link that opens a chrome setting it not open so i should open it manually, it open on an empty tab so how can I do this or automate this process if it will not in the normal way.
Thanks in advance. -
Hello
iam want to open a link in google chrome browser so I use this codeQString link = "http://www.google.com"; QDesktopServices::openUrl(QUrl(link));
but here is the problem when i use this link to open it in chrome
chrome://settings/
any link that opens a chrome setting it not open so i should open it manually, it open on an empty tab so how can I do this or automate this process if it will not in the normal way.
Thanks in advance.@AmrCoder said in Open a Link in google chrome using QT:
chrome://settings/
are you sure you can open that page with Chrome (by the way, please state your OS) from command line?
-
iam using Windows 10
QT 5.10.0
no really if I try to open this link which is setting page I can't open it using the command line like thischrome.exe chrome://setting/
but for sure it opens other websites to use this link in google chrome I must write it manually in the search bar.
-
Hi
That will not work on Windows as
chrome: is NOT registered as a protocol.
The concept is called URI Schemes
its possible to add to registry new ones
https://stackoverflow.com/questions/389204/how-do-i-create-my-own-url-protocol-e-g-soBUt that might not be optimal but depends on your actual use case :)
-
Hi
That will not work on Windows as
chrome: is NOT registered as a protocol.
The concept is called URI Schemes
its possible to add to registry new ones
https://stackoverflow.com/questions/389204/how-do-i-create-my-own-url-protocol-e-g-soBUt that might not be optimal but depends on your actual use case :)
-
@Pablo-J.-Rogina
I think you are right. For safety reason.
But i never tried with chrome settings. Only an actual custom protocol. :)