Jump to content

WebBrowser Control Usage in VSTO Addin


Michel Laplane
 Share

Recommended Posts

Hi All,

I've just made available a new github project for using BabylonJS with Microsoft Visio. It enables Visualization of Visio Diagram in 3D.

https://github.com/MichelLaplane/VisualShow3DLight

Even it is a very simple use for now, I'm faced with two problems :

- How to disable the security warning when launching WebBrowser Control

- How to call JS function that are in other file than the HTML landing page of the solution.

Any suggestions will be appreciated.

 

Link to comment
Share on other sites

Thanks for you interest.

"(Translated from French) For helping you to protect your desktop, you web browser had blcoked the display of active content click here to enable".

So the user needs to authorize access. Of course after that all is working well, but the user need to authorize again for the next session

This is the normal behavior of Edge, but don't know if it can be disabled and best suitable by code.

Link to comment
Share on other sites

I remember this warning from ActiveX websites, I don't think I ever saw it with JavaScript :)

Sounds like browser setting for me, which you cannot control. But I can't really give a proper answer, as I don't know the project. Maybe someone else know this issue better!

Do you happen to have mixed content (ssl/no-ssl)? Might also be a problem with some browsers. 

Link to comment
Share on other sites

For the second problem, to be more precise, if you begin to execute your script in the landing html using Script tag as usual, you cannot after that call a function in another file, event if you add the corresponding "script src = ..." that normally would include the js code of your other file.

So I've done a trick, the execution flow is directly called in the main.js file.

If I try in the html to call startView, the function is not defined, so I execute directly in another js file. So you would tell me where is the problem?

In fact the problem is here again and is more annoying if I want to call a JS function from c# :

in "FrmBabylonScene.cs"

...

    private void btnFloorPlanAll_Click(object sender, EventArgs e)
      {
      // This does not work because the function is not in the HTML File
      // Don't find a solution for that
      webBrowserBabylon.Document.InvokeScript("GenerateAll");
      }

You can look at the code in the GitHub repository :

https://github.com/MichelLaplane/VisualShow3DLight

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...