Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

AddHostObject HTML broken (not-implemented)? #78

Open
the-Arioch opened this issue Jan 17, 2025 · 2 comments
Open

AddHostObject HTML broken (not-implemented)? #78

the-Arioch opened this issue Jan 17, 2025 · 2 comments

Comments

@the-Arioch
Copy link
Contributor

the-Arioch commented Jan 17, 2025

When i compile and run D:\DelphiLibs\WebView4Delphi\demos\Delphi_VCL\AddHostObject\AddHostObject.dpr the bottom frame says like "IP not found" and indeed the HTML says

    <script>
        //! Create IFrame from the parent html page and load it
        function createIFrame() {
            var i = document.createElement("iframe");
            i.src = "https://appassets.example/ScenarioAddHostObject.html";
            i.scrolling = "auto";
            i.frameborder = "0";

Yet the demo sources does not seem to add custom schema/domain filters for handling https://appassets.example/ nor is there any ScenarioAddHostObject.html in the D:\DelphiLibs\WebView4Delphi\assets\ folder

is there some abandoned feature, the test was intended to implement one day, but did not?

@salvadordf
Copy link
Owner

I see that Microsoft did some changes in the documentation about the ICoreWebView2.AddHostObjectToScript method recently.

That demo already had another issue with the "help wanted" label. I'll try to find some time to investigate this.

@the-Arioch
Copy link
Contributor Author

the-Arioch commented Jan 19, 2025

Well, the demo mostly works, albeit in some not the most intuitve way, but it worked for me with Win10 + Delphi 2007

except for the async method call, which was not designed to provide any visual feedback, so technically it probably worked too, just gave no clue to the observing user

then i was looking into the sources that maybe that async method call should've visible chanhe the iframe state - and got this. Probable reason is jsut you have all the necessary file in your working dir but jsut forgot to git add them, it happens :-)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants