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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

How to implement clicking URL "my://showAdialog" just showing a dialog without changing the current page content?

Post Reply
nbuyer
Posts: 7
Joined: Mon Dec 19, 2022 1:42 am

How to implement clicking URL "my://showAdialog" just showing a dialog without changing the current page content?

Post by nbuyer »

Hi,

I wish to implement clicking a custom URL (e.g. my://showmsg/abc) inside my page to call my Windows App to display a dialog box with "abc" information, and I want the page to remain unchanged after closing the dialog box.

Currently, I'm using js via ExtensionHandler.Execute() to do that, but can ICefResourceHandler be implemented directly to achieve a similar effect? Right now I only know how to use TCustomResourceHandler to return something like a jpg that returns a stream and can't return a “no data” response.


Thanks for your help.
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to implement clicking URL "my://showAdialog" just showing a dialog without changing the current page content?

Post by salvadordf »

Hi,

Try using TChromiumCore.OnBeforeBrowse to cancel the navigation with that URL and then send a Windows message to the form to show the dialog asynchronously.
nbuyer
Posts: 7
Joined: Mon Dec 19, 2022 1:42 am

Re: How to implement clicking URL "my://showAdialog" just showing a dialog without changing the current page content?

Post by nbuyer »

That's a good idea, though not very elegant. :-p
I will try. Thanks.
Post Reply