I'm making a search on Google.com, and a phone number appears. When I click on it, it stays on a white screen. Please help me with what I need to do to open the phone number in an application like Skype or a different app.
https://prnt.sc/c27kULY8QV0o
https://prnt.sc/R2QNNlABtm-o
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Click Tel : Phone problem
- salvadordf
- Posts: 4084
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Click Tel : Phone problem
Hi,
Try using the TChromium.OnProtocolExecution event. If that link is using a different protocol then you can intercept it in this event and execute a third party application to handle the new URL.
Try using the TChromium.OnProtocolExecution event. If that link is using a different protocol then you can intercept it in this event and execute a third party application to handle the new URL.
-
- Posts: 6
- Joined: Mon May 21, 2018 6:46 pm
Re: Click Tel : Phone problem
thank you bro.salvadordf wrote: ↑Fri Jun 09, 2023 3:05 pm Hi,
Try using the TChromium.OnProtocolExecution event. If that link is using a different protocol then you can intercept it in this event and execute a third party application to handle the new URL.
Code: Select all
procedure TForm1.Chromium1ProtocolExecution(Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame;
const request: ICefRequest; var allowOsExecution: Boolean);
var
PhoneNumber: string;
SkypeCommand: string;
Response: ICefProcessMessage;
begin
// Telefon numarası linki kontrolü
if Pos('tel:', request.Url) = 1 then
begin
// Telefon numarasını al
PhoneNumber := Copy(request.Url, 5, Length(request.Url));
// Skype komutunu oluştur
SkypeCommand := 'skype:' + PhoneNumber;
// Skype ile telefon numarasını aç
ShellExecute(0, 'open', PChar(SkypeCommand), nil, nil, SW_SHOWNORMAL);
// Telefon numarası açıldığında Google'a bir yanıt döndür
Response := TCefProcessMessage.New('custom_protocol_execution');
Response.ArgumentList.SetString(0, 'skype');
Chromium1.SendProcessMessage(PID_BROWSER, Response);
// Telefon numarası açıldığından emin olmak için işlemi durdur
allowOsExecution := False;
end;
end;
https://prnt.sc/D35O_eRlqt1r
-
- Posts: 6
- Joined: Mon May 21, 2018 6:46 pm
Re: Click Tel : Phone problem
thank you bro.salvadordf wrote: ↑Fri Jun 09, 2023 3:05 pm Hi,
Try using the TChromium.OnProtocolExecution event. If that link is using a different protocol then you can intercept it in this event and execute a third party application to handle the new URL.
Code: Select all
procedure TForm1.Chromium1ProtocolExecution(Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame;
const request: ICefRequest; var allowOsExecution: Boolean);
var
PhoneNumber: string;
SkypeCommand: string;
Response: ICefProcessMessage;
begin
// Telefon numarası linki kontrolü
if Pos('tel:', request.Url) = 1 then
begin
// Telefon numarasını al
PhoneNumber := Copy(request.Url, 5, Length(request.Url));
// Skype komutunu oluştur
SkypeCommand := 'skype:' + PhoneNumber;
// Skype ile telefon numarasını aç
ShellExecute(0, 'open', PChar(SkypeCommand), nil, nil, SW_SHOWNORMAL);
// Telefon numarası açıldığında Google'a bir yanıt döndür
Response := TCefProcessMessage.New('custom_protocol_execution');
Response.ArgumentList.SetString(0, 'skype');
Chromium1.SendProcessMessage(PID_BROWSER, Response);
// Telefon numarası açıldığından emin olmak için işlemi durdur
allowOsExecution := False;
end;
end;
https://prnt.sc/D35O_eRlqt1r
- salvadordf
- Posts: 4084
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Click Tel : Phone problem
Hi,
Process messages are used to send information between the Chromium processes.
TChromium.OnProtocolExecution is executed in the main browser process. In fact it's executed in a CEF thread but you can send a normal Windows message to the main form to execute something else in the main application thread.
Process messages are used to send information between the Chromium processes.
TChromium.OnProtocolExecution is executed in the main browser process. In fact it's executed in a CEF thread but you can send a normal Windows message to the main form to execute something else in the main application thread.